Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

297.Advanced search and replace -- How to add some text after the 5th line for every file in a directory?

User: editor -- 2008-11-21          << 296  298 >>
Hits: 404
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to add some text after the 5th line for every file in a directory?
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-h open "Replace" dialog
* set "Replace Unit" to "Line"
* set "Unit Number Filter" to 
* set "Replace with Pattern" to:

2. click "Batch ..."
3. click "Pick Files" or "Search Files" to select multiple file.
4. if save to new file, change "set output filename" to new value like ${BASE}.new.${EXT}
5. if save to new directory, set "change output folder"
6. click "Batch Replace", done!
Download Script:  scripts/297.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to merge 3 text files by getting one line from each file repeatly? (59%)
How to split every file in a directory automatically? (57%)
How to batch rename text files with random line from file contents? (56%)
How to rename mutiple files with the 3rd and 4th line in file content? (55%)
How to convert each line of a text file to the new format? (55%)
How to take every line from file A and file B and calculate summary? (54%)
How to add one line after Sub or Function in the VBA Text File? (53%)
How to add a single space after each character in a text file? (53%)

Check Demo of Advanced search and replace
Keywords:
directory  after  unit number filter  number filter  output folder  dir  every  filter  folder  pick  new line after  output a directory to text file  add text every line  add text to multiple filename  after text  add filename in text file  replace after  replace text with filename in