I am doing some pre-processing on files. I have 2 text files which contains data in the following format.
Text File 1
"Name","Age","Class"
"Total Students:","247"
"John","14","8"
"Sara","13","8"
Text File 2
"Name","Age","Class"
"Total Students:","119"
"John","15","9"
"Sara","16","9"
What I am trying to do is I am removing top 2 rows from these files and quotes and then moving the files to the output directory by using the following commands.
sed '1d' "$file" >> temp.txt
sed -i '1d' temp.txt
sed -i 's/"//g' temp.txt
mv temp.txt output/$file
The problem I am facing is that, these commands only apply to a single file. The file names are Class_8.txt and Class_9.txt. Is there any solution I can apply same command to both files? I wanted to retain the orignal file and move the processed files to output folder.