![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need loop clarification for the below code | mail2sant | Shell Programming and Scripting | 2 | 10-30-2008 03:33 PM |
| Pick up the return code for every iteration and display the result only once in loop. | manas6 | Shell Programming and Scripting | 1 | 10-21-2008 08:12 AM |
| loop through the directory for files and sort by date and process the first file | dsdev_123 | AIX | 1 | 01-30-2008 05:31 PM |
| the given code goes in infinite loop and does not increment variable i | mrityunjay22 | Shell Programming and Scripting | 6 | 12-26-2007 02:20 AM |
| Loop through files in a directory | rladda | Shell Programming and Scripting | 4 | 06-24-2005 06:30 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Loop certain code to all files within directory
Hi all, Can somebody help me with this problem pls. I need to extract one specific line from each files in a folder and put the all lines extracted in a unique output file in the following format. line extracted, respective name of file, date of file. I´m, trying the part to extract the desired line with Code:
awk '/Category/ {getline; print}' infile.txt
But I dont know how to do a loop over all files and send all lines to one outfile.txt with the format desired. Example: If the line extracted from one specific file with Code:
awk '/Category/ {getline; print }' infile.txt
is "District school", the desire result would be: Code:
District school, file date, file name Thanks in advance for any help |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|