I have a file called script.sh
with the following code:
#!/bin/bash
file=list.txt
IFS=$','
cat $file
for i in `cat $file`
do
echo "The name of the file I am going edit is $i"
awk 'BEGIN{FS=OFS=","} /^\<AA_xx\>/||/^\<AA\>/{$160="CC,0,DD,0"} 1' $i \
> temp_file.csv && mv temp_file.csv $i
done
list.txt
contains the path to a .csv
file, e.g., /ws/user/stack.csv
.
However, I would like to modify this script to read all the files I specify in list.txt
, i.e., my list.txt
contains
/ws/user/stack.csv
/ws/user/stack1.csv
/ws/user/stack2.csv
I want the script to use this awk in each file mentioned in list.txt
.
Can you help me with this?