Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

350.Replace text in multiple files -- How to batch change format of multiple files?

User: editor -- 2009-08-28          << 349  351 >>
Hits: 3285
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
How to batch change format of multiple files?
Input Sample:
source file format:
  site s1   x                 =0;  y !y1_actinoli 0.7231  z               =1/2;  occ NA+1 0.04  beq 0.970
              occ CA+2 0.88  beq 0.970
              occ MN+2 0.08  beq 0.970
  site s2   x                 =0;  y !y2_actinoli 0.9113  z               =1/2;  occ MG+2 0.39  beq 0.580
              occ FE+2 0.61  beq 0.580
  site s3   x                 =0;  y !y3_actinoli 0.8214  z                 =0;  occ MG+2 0.34  beq 0.550
Output Sample:
Target file format:
  site NA   x                 =0;  y !y1_actinoli 0.7231  z               =1/2;  occ NA+1 0.04  beq 0.970
              occ CA+2 0.88  beq 0.970
              occ MN+2 0.08  beq 0.970
    site MG   x                 =0;  y !y2_actinoli 0.9113  z               =1/2;  occ MG+2 0.39  beq 0.580
              occ FE+2 0.61  beq 0.580
    site MG   x                 =0;  y !y3_actinoli 0.8214  z                 =0;  occ MG+2 0.34  beq 0.550
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Summary of the question: the "site sXX" and "occ YY" are in the same line, replace "site sXX" with "site YY"

1. open "Tools->Batch Runner" window
2. click "Pick Files" to pick multiple files
3. If you want rename file at the same time, check "set output filename" option, and change ${FILENAME} to the format you need.
4. Click "Fast Replace" button, open "Fast Replace" dialog
* Click "Add" 
* Enter "Search=>" to be 
* Enter "Replace=>" to be 
* Click "OK"
* Make sure "Regular Exp" option is checked, then Click "Start", done!

Note: to avoid unexpected data loss, please make backup before any change operation.

Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to replace strings and numbers with new format in multiple files? (67%)
Make a batch file to change name of all files  (66%)
How to extract first 55 characters form multiple .txt.files? (65%)
How to read each line of a file and insert into multiple files? (64%)
How to change date from ddmmyy to yymmdd in multiple filenames? (64%)
How to exchange column 2 and column 3 in multiple csv files? (64%)
How to attach the md5 sum to the end of filename for multiple files? (64%)
How to extract last 100 lines from multiple files? (63%)

Check Demo of Replace text in multiple files
Keywords:
summary  change format of multiple files  question  site  backup  same  before  bef  befor  operation  change format occ to  batch file to backup and rename files  rename multiple files replace text  change multiple text file format  rename files replace text  batch rename replace text  replace with multiple data  replace text rename