Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

970.Replace text in multiple files -- How to search/replace multiple text files base on rules from csv file?

User: Roger24 -- 2012-07-12          << 969  971 >>
Hits: 4814
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
I have a .csv file that looks like in the Source text sample, and i need to search & replace in all .sql files, so search for the expression on the first column in the csv file, and replace with content of the second column. 
How to do this?
Input Sample:
"raise_application_error(-20114, 'Error message!');","'New message'"
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open your csv file 
2. ctrl-h open 'replace' dialog 
* set 'replace unit' to 'Line' 
* set 'search for pattern' to: 
 
* set 'replace with pattern' to: 
 
3. click 'replace', 
4. ctrl-s save the result to a new file, such as replace.txt 
 
5. open "Tools->Batch Runner" window, and drag multiple ".sql" files into "Batch Runner" window 
6. click "Fast Replace" button to open "Fast Replace" dialog, click "import" button to import the file replace.txt, which is generated in step 4,  you can also simply drag replace.txt and drop to "Fast Replace" dialog. 
7. uncheck option of "Reg exp" and "Cross Line" 
8. click "Start", and click "ok", done! 
 
Note: please make backup in advance to avoid mis-operation.

Screenshot 1:  Replace_Window


Screenshot 2:  Fast_Replace_Window


Similar Examples:
How to search and replace in multiple files base on user-defined mapping file? (74%)
How to search and replace multiple file with multiple regex rules? (69%)
How to search and replace multiple files with rules different in sequence number? (68%)
How to refine multiple text files by specified rules? (67%)
How to search and replace text base on csv file column 1 and 2? (66%)
How to split multiple text files by 100 lines? (65%)
How to extract multiple fields from data file and create a csv file? (65%)
How can I search and replace multiple strings in multiple files all at once? (64%)

Check Demo of Replace text in multiple files
Keywords:
sql  iso  second column  backup  first column  import  rules  find  second  cross line  column expression replace  csv first column  file and replace all in files with csv  multiple files into csv  drop column  search for text in multiple csv files  replace with csv files multiple  search and replace text in csv files