Contents of Data File:
123-2009-123-123
456-2008-123-0
789-2009-100-0
awk Code:
BEGIN {
# Set the field seprator
FS="-";
}
/2009/
{
print "Updating " $2 " data";
}
}
Output:
All lines are printed
I am executing my script as follows
cat test.dat | nawk -f update.awk
Can somebody please let me know where I am going wrong ?
Thanks in advance
rogers42
123-2009-123-123
456-2008-123-0
789-2009-100-0
awk Code:
BEGIN {
# Set the field seprator
FS="-";
}
/2009/
{
print "Updating " $2 " data";
}
}
Output:
All lines are printed
I am executing my script as follows
cat test.dat | nawk -f update.awk
Can somebody please let me know where I am going wrong ?
Thanks in advance
rogers42