I need to create an if statement which states that if the 9th field of a file is blank, to print the line "the following lines are incomplete."
Currently my script looks like this:
BEGIN{
FS=";"
}
NF !=9 {
printf("%s\n", "The following line is incomplete."
printf("%s : %d\n", FILENAME, FNR);
}
basically I want the script to be able to label a file such as this as an error.
222;333;eedie;sunday;23423;90;asdfsd;adfds.dfdaf;
As of now my script doesn't detect this as an error because it is seeing that there is nine fields, but I need it to detect that the ninth field is empty. The user would look at this file and realize that a period is separatnig the true 8th and 9th field.
Any help is GREATLY appreciated!!!!!
Currently my script looks like this:
BEGIN{
FS=";"
}
NF !=9 {
printf("%s\n", "The following line is incomplete."
printf("%s : %d\n", FILENAME, FNR);
}
basically I want the script to be able to label a file such as this as an error.
222;333;eedie;sunday;23423;90;asdfsd;adfds.dfdaf;
As of now my script doesn't detect this as an error because it is seeing that there is nine fields, but I need it to detect that the ninth field is empty. The user would look at this file and realize that a period is separatnig the true 8th and 9th field.
Any help is GREATLY appreciated!!!!!