I have a file content.txt where I want to replace the value of second column of the file with half of the value of that column.
I only have to replace if the second column starts with COM_, rest all values have to be same
eg,
while IFS=\| read ColA ColB ColC ColD
do
...
done < file
So IFS does not need to be set and reset..
Note that ColA is empty, ColD contains both columns 4 and 5 and ColC needs to be changed if ColB meets the criteria..
1 more question, is it possible to add one more level of validation,
like currently the code is working if the second column startes with _COM
I want to add one more level as the third column should only be "Scen"