hello99hello
Programmer
Hello All,
I have a file (levln_ac_in.txt) with the following sample record format:
200159,,,3/21/1996,3/22/1996,,VACATION,VAC.TAKEN OTHER GRPS,,15,,,0
I am trying to extract the contents of the 8th column of each record of file levln_ac_in.txt and put it in an output file levln_dt_in.txt
Here is my effort:
#!/bin/sh
#extract column 2 from file
awk -v c=8 'NR==r { print $c }' levln_ac_in.txt > levln_dt_in.txt
my output file should contain the following format sample records:
VAC.TAKEN OTHER GRPS
However the output file is retunring zero, please help.
I have a file (levln_ac_in.txt) with the following sample record format:
200159,,,3/21/1996,3/22/1996,,VACATION,VAC.TAKEN OTHER GRPS,,15,,,0
I am trying to extract the contents of the 8th column of each record of file levln_ac_in.txt and put it in an output file levln_dt_in.txt
Here is my effort:
#!/bin/sh
#extract column 2 from file
awk -v c=8 'NR==r { print $c }' levln_ac_in.txt > levln_dt_in.txt
my output file should contain the following format sample records:
VAC.TAKEN OTHER GRPS
However the output file is retunring zero, please help.