Hey thanks for your comment!
(note i realised i was working on the wrong results folder now in "results" instead of "kreport" which is why there is a change to the file and folder names but the problem is still the same)
I tried out your suggestion:
for k in */centrifuge/results/*.txt; do name=$(basename $k); cat $k | cut -f 1,3 > /krona/$name.krona; echo $k; done
but am still getting the following error:
-bash: /krona/A4_results.txt.krona: No such file or directory
Drains_2/centrifuge/results/A4_results.txt
-bash: /krona/B1_results.txt.krona: No such file or directory
Drains_2/centrifuge/results/B1_results.txt
-bash: /krona/B6_results.txt.krona: No such file or directory
Drains_2/centrifuge/results/B6_results.txt
-bash: /krona/D1_results.txt.krona: No such file or directory
Drains_2/centrifuge/results/D1_results.txt
-bash: /krona/E4_results.txt.krona: No such file or directory
Drains_2/centrifuge/results/E4_results.txt
-bash: /krona/NC_D2_results.txt.krona: No such file or directory
Drains_2/centrifuge/results/NC_D2_results.txt
-bash: /krona/C4_results.txt.krona: No such file or directory
Drains_4/centrifuge/results/C4_results.txt
-bash: /krona/D3_results.txt.krona: No such file or directory
Drains_4/centrifuge/results/D3_results.txt
-bash: /krona/E7_results.txt.krona: No such file or directory
Drains_4/centrifuge/results/E7_results.txt
-bash: /krona/G1_results.txt.krona: No such file or directory
Drains_4/centrifuge/results/G1_results.txt
-bash: /krona/I1_results.txt.krona: No such file or directory
Drains_4/centrifuge/results/I1_results.txt
-bash: /krona/I8_results.txt.krona: No such file or directory
Drains_4/centrifuge/results/I8_results.txt
-bash: /krona/NC_D4_results.txt.krona: No such file or directory
Drains_4/centrifuge/results/NC_D4_results.txt
-bash: /krona/A7_results.txt.krona: No such file or directory
Drains_6/centrifuge/results/A7_results.txt
-bash: /krona/B4_results.txt.krona: No such file or directory
Drains_6/centrifuge/results/B4_results.txt
-bash: /krona/B7_results.txt.krona: No such file or directory
Drains_6/centrifuge/results/B7_results.txt
-bash: /krona/C10_results.txt.krona: No such file or directory
Drains_6/centrifuge/results/C10_results.txt
-bash: /krona/C1_results.txt.krona: No such file or directory
Drains_6/centrifuge/results/C1_results.txt
-bash: /krona/D7_results.txt.krona: No such file or directory
Drains_6/centrifuge/results/D7_results.txt
-bash: /krona/NC_D6_results.txt.krona: No such file or directory
Drains_6/centrifuge/results/NC_D6_results.txt
-bash: /krona/A6_results.txt.krona: No such file or directory
Drains_7/centrifuge/results/A6_results.txt
-bash: /krona/A8_results.txt.krona: No such file or directory
Drains_7/centrifuge/results/A8_results.txt
-bash: /krona/C7_results.txt.krona: No such file or directory
Drains_7/centrifuge/results/C7_results.txt
-bash: /krona/C9_results.txt.krona: No such file or directory
Drains_7/centrifuge/results/C9_results.txt
-bash: /krona/G6_results.txt.krona: No such file or directory
Drains_7/centrifuge/results/G6_results.txt
-bash: /krona/H1_results.txt.krona: No such file or directory
Drains_7/centrifuge/results/H1_results.txt
-bash: /krona/NC_D7_results.txt.krona: No such file or directory
Drains_7/centrifuge/results/NC_D7_results.txt
It is looping and showing me that at least its finding the files i want it to execute on but its still giving me the same error. Sorry for not being very useful in giving you more information to help.
Do you actually need
/krona/(in the root folder) or rather justkrona/in the current directory?Ideally i would like a folder in the same directory as the three kreport.txt files which contains the results (the altered version of these three files). Drain_5 and Drain_7 also have the same file structure so hopefully the loop will produce the same result as well.