I am creating a script that will enter a file (XYZ) and verify that a list of files (ABC) within the file (XYZ) have a certain number of fields. Specifically, I am checking to see that the listed files have nine fields and are separated by a semi-colon ; delimiter. Here is what I have so far. I need help creating part of the script that echoes the line number of any file that isn't 9 fields long or that doesn't have a semi-colon as a delimiter. Can anyone help?
BEGIN{
FS=";"
}
{
if ( NF != 9)
{
printf("%s\n", $0)
}
else
{
printf("%s\n", "The line is complete"
}
}
Any help would be much appreciated.
Thanks
BEGIN{
FS=";"
}
{
if ( NF != 9)
{
printf("%s\n", $0)
}
else
{
printf("%s\n", "The line is complete"
}
}
Any help would be much appreciated.
Thanks