i want to change the value of f3 cell before the echo statement in while loop
Exec &> output.csv
file = "d:/aa.csv"
while ifs =','
read f1 f2 f3 f4 f5 f6 f7 f8
do
echo "$f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8"
done < $file
If you want to change the value, then change it. Correcting errors:
while IFS=, read -r f1 f2 f3 f4 f5 f6 f7 f8
do
f3="something else"
echo "$f1,$f2,$f3,$f4,$f5,$f6,$f7,$f8"
done < "$file" > output.csv
or
IFS=,
while read -ra fields; do
fields[2]="something else"
echo "${fields[*]}"
done < "$file" > output.csv
ifs? Did you mean to writeIFS?