I would like to write a shell script that allows me to open a text file with a particular name and write the name of the file at the beginning of every line. So, if my file is called "test" and it has three lines:
SCORE1 567
SCORE2 434
SCORE3 789
the script would open it and change it to this:
test SCORE1 567
test SCORE2 434
test SCORE3 789
Then it should save it overwriting the original file.
Ideally, the script would perform this modification to all the files in a particular folder, writing inside each one the name of that particular file in every line.
Once this process is done, I will feed these files to another script that will combine them in a single one that will be later analyzed with a spreadsheet.
Could you help me with this? I have some ideas, but I would like to read yours. I almost have not experience writing shell scripts.