Using Cat within AWK 
Author Message
 Using Cat within AWK


Quote:

>I am writing an AWK script that will be creating a file from which I
>need to extract data.  I just need to be able to run the equivalent of
>"cat some_file.dat|awk '{print $5}'>test" from within AWK using the
>"system()" function.

Highly unlikely (and UUOC).

Quote:
>I can't use the "getline" function because I am trying to do this from
>a "while" loop within a "while" loop and am reusing (overwriting) the
>same file over and over again.  It appears that the "getline" will run
>through the datafile2.dat file the first time, set the system variable
>to "0" (indicating end-of-file to "getline") and will not run through
>the file the next time the loop is executed.  The code format is
>something like this:

"man awk" and check the section on the close() command.

close() will clear the EOF condition on the file.



Sun, 01 May 2005 00:52:47 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. using Oracle within an awk script

2. Awk within awk??

3. size limit using cat

4. Outputting info from awk and using the info to name the awk output file

5. Replacing a string from an input file within awk script

6. trying to call awk from within a shell script

7. quick help needed: reading from a file within awk

8. Run awk from within sed script?

9. copy a file from within awk?

10. shell commands within awk script

11. Simple awk command within a perl script

12. Two pipes within awk....

 

 
Powered by phpBB® Forum Software