1. Example: Importing file-per-line data¶
The Import Wizard allows users to provide specific options when importing data. In this example demonstrates import of a modified TOFWERK instrument export with the file names in Export filenames.. The process will be similar for other programs that export lines as a directory of separate files. The directory to be imported contains the files in Export filenames.. See also Import Wizard.
…/TOFWERK data/TW_Image3_25um2018.12.05-12h17m15s_AS.csv |
…/TOFWERK data/TW_Image3_25um2018.12.05-12h17m49s_AS.csv |
…/TOFWERK data/TW_Image3_25um2018.12.05-12h18m19s_AS.csv |
474 more files… |
…/TOFWERK data/TW_Image3_25um2018.12.05-16h23m13s_AS.csv |
…/TOFWERK data/dummy_file.csv |
t_elapsed_Buf |
‘[23Na]+’ |
‘[24Mg]+’ |
… |
|---|---|---|---|
0 |
1287.785 |
13.095236 |
… |
0.10057113011 |
1664.5214 |
52.331398 |
… |
… |
… |
… |
… |
25.9500810667 |
202654.8 |
1448.4713 |
… |
End of file. |
|||
- Select the CSV Lines format.
This sets up the import wizard for CSV-as-lines import.
- Select the path to the data.
Either drag-and-drop or use the Open Directiory dialog to select the TOFWERK data directory. The number of Matching files is now 479, one more than the 478 lines.
- Select import options.
The file delimiter is ‘,’. Looking at the Export structure. we can see the is no header and one footer line, the Footer Rows should be set to 1.
- Select the File Regex.
The default regex
.*\.csvwill import all files ending with ‘.csv’. In our example there is a dummy filedummy_file.csvwe do not want to import, we can set the regex to also look for ‘TW_Image3’ at the start of the filenames,TW_Image3.*\.csv. The number of Matching files is now 478.
- Select the Sorting.
The exports in this example are marked with a timestamp, in most cases simple alphabetical sorting will work but we can also use the ‘Timestamp option’. Set Sorting to timestamp and the sort key to
%Y.%m.%d-%Hh%Mm%Ss.
- Select laser parameters and isotopes for import.
Input the laser parameters. Non data names such as ‘t_elapsed_Buf’ can be removed by pressing the Edit Names button.