awk -- Input file not in command line

Score
0
Vote Up
April 26, 2011 at 12:52:52 Pacific
Specs: unix AIX

I see several files read into arrays. However, two of the files aren't in the command line.
The below example is one of the files not in the command line.
Is is possible to read a file without it being in the command line?

awk code :
FILENAME=="exUsoc.dat"{
exUsoc[$1]=1
next}


Reply ↓  Report •


#1
Vote Down
Score
1
Vote Up
April 26, 2011 at 14:26:52 Pacific

You can read text files into an array using the getline function, but FILENAME is the name of the current input file. To me that means this code block:

FILENAME=="exUsoc.dat"{
exUsoc[$1]=1
next}

will never be true unless the exUsoc.dat file is on the command line.

Let me know if I've misinterpreted your question.


Reply ↓  Report •
Reply to Message Icon Start New Discussion
Related Posts

« My Documents - default pa... .bat start random file »

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.

Ask the Community!
Describe your Problem
Example: Hard Drive Not Detected on My PC