I am trying to add a column to a file:
1 12098 12258 0.00
1 12553 12721 1.37
1 13331 13701 34.69
1 30334 30503 0.00
1 35045 35544 0.00
1 35618 35778 0.00
1 69077 70017 0.24
1 324294 324394 0.68
1 324427 325605 3.18
so it looks like this:
1 12098 12258 unknown 0.00
1 12553 12721 unknown 1.37
1 13331 13701 unknown 34.69
1 30334 30503 unknown 0.00
1 35045 35544 unknown 0.00
1 35618 35778 unknown 0.00
1 69077 70017 unknown 0.24
1 324294 324394 unknown 0.68
1 324427 325605 unknown 3.18
I have managed to do it using this command:
awk '$3 = $3 FS "unknown"' <file> > <new_file>
However I have over 900 files that I need to do this too and output to a new file on each occasion. I find awk complicated to understand and was wondering whether there is a way to do this using #SBATCH scripts or any other method for multiple files at a time?
I am pretty new to stack overflow, so any help would be greatly appreciated! Thank you!