Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

832.Replace text in multiple files -- How to add filename as a new column for multiple csv/txt files?

User: park -- 2011-08-02          << 831  833 >>
Hits: 3932
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
how to add one column which is the filename in multiple txt files?
Input Sample:
filename:sz000001.txt 
Input Sample: 
1991/12/23,1.56,1.56,1.55,1.56,127000, 
3530600.000 
1991/12/24,1.56,1.61,1.53,1.60,105000, 
3050250.000 
1991/12/25,1.60,1.63,1.60,1.61,226900, 
6648170.000 
1991/12/26,1.61,1.61,1.57,1.57,191800, 
5370400.000
Output Sample:
filename:sz000001.txt 
sz000001,1991/12/23,1.56,1.56,1.55,1.5 
6,127000,3530600.000 
sz000001,1991/12/24,1.56,1.61,1.53,1.6 
0,105000,3050250.000 
sz000001,1991/12/25,1.60,1.63,1.60,1.6 
1,226900,6648170.000
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open "Tools->Batch Runner" menu 
2. drag multiple csv/txt files from windows to "Batch Runner" window 
3. click "Fast Replace" button to open "Fast Replace" window 
4. click "Add" to add a rule 
* set "search" to:  
* set "replace" to: 
click ok. 
5. make sure "Reg exp" option is "checked", and "Cross Line" option is "unchecked" 
6. click "Start", done.

Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to delete the second column in multiple text files? (75%)
How to merge more columns into one column in multiple csv files? (68%)
How to add a timestamp at the beginning of multiple text files? (67%)
How to delete last column in a csv file? (65%)
How to add empty line at begin of multiple files? (64%)
How to delete all lines with column B greater than 90 in multiple csv files? (64%)
How to remove/delete first column for multiple files? (63%)
How to exchange column 2 and column 3 in multiple csv files? (62%)

Check Demo of Replace text in multiple files
Keywords:
add one column  cross line  new column  csv  add filename  rule  base  fast replace  fast  fas  add the filename as a column for multiple files  add filename as column txt  add one new column  add filename to multiple txt files  add filename to multiple files windows  how to add text in multiple filename  how to add multiple text to filename  add text to multiple filename