File with 3 columns

friends

I have a file that process but before doing anything asegurqarme I have only 3 columns as puedop make that validation with awk or some other function.

example

1;100;500
101;800;600
801;900;700

I am unable to find the terms "asegurqarme" and "puedop" in any of my dictionaries. Please restate your problem clearly in English with sample input, sample output, and describe the logic used to guide the actions of the script you want to produce.

Also, please tell us what operating system and shell you are using, and show us what code you have tried to solve this problem on your own.

It all depends of what your intentions are for validation. Is it per line? Is it as per file as a whole?
Also, what action would you like to take if the validation is successful or unsuccessful.

For example: you can display lines that have only three columns.

awk -F";" 'NF==3' tricampeon81.file

Any line that contains less or more than three fields (columns) will not be displayed.

if all three field needed to run a process then try some script like:

while IFS=";" read a b c
do
   [[ -n "$a" ]] && [[ -n "$b" ]] && [[ -n "$c" ]] && {
      echo processing record: "$a;$b;$c"
      #... do something else
   }
done < infile
1 Like