I'm currently trying to write a perl script.
I have a folder containing CSV files contained in the following directory:
The files are currently named in the format: "20130730_p12_A1.csv" (csvfiles.jpg attached).
Each CSV file contains two columns: "mass" and "intensity".
Firstly, what I'd like to do, is to take the full name of each file (201307030_p12_A1) and add it to the next adjacent column for each of these files, under the heading "filename". This filename will then be "copied down" to the last entry within the table (filename-column.jpg attached).
Once this column has been added to each CSV file, the next step will be to modify the filename for each CSV file.
First of all, the date and "p12" should be removed from each filename, so:
would simply read:
Secondly, a text file (mapcodelist.txt) will be used to add information into the filename.
For naming convention, I'd like to change any full stops (".")s within mapcodelist to underscores ("_")s.
I'd then like to tie up this mapcodelist information with the CSV files.
Using mapcodelist.txt (attached), A1.csv
A2.csv becoming A2_G0_808.csv
A3.csv becoming A3_OUM19363.csv
and so on...
If anybody could possibly help me out with this, I'd very much appreciate it.