Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1114.Replace text in multiple files -- How to copy a line containing specified word and insert between line 1 and 2?

User: Rod Smith -- 2013-08-12          << 1113  1115 >>
Hits: 1649
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
Find a line in a file contain a certain word and
copy that line and insert it as the a new second line from the top of the file the original line 2 become line 3.
No line is deleted from the file. We now have a new added line 2 copy of the line with the target text.
Input Sample:
line 1
line 2
more lines
Line with TARGET TEXT(but may be last line in file)
possibly more lines
Output Sample:
line 1
Line with TARGET TEXT(copied here))
Line 3(was line 2)
more lines
Line with TARGET TEXT(still here also)
possibly more lines
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open "Tools->Batch Runner" window
2. drag multipe files from "file explorer" to 'batch runner' window
3. click "Fast Replace" button
4. click "add" to add new rule
* leave 'search' to be blank
* set 'replace' to:

* click "ok"
3. click 'start', done.

Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to remove lines containing specified words in a text file? (69%)
How to extract random lines containing specified words? (64%)
How to extract lines containg specified words from many files? (63%)
How to caplitalize all specified words between ">" and first "#"? (61%)
How to remove everything but specified strings between begin and end? (60%)
How to findout all lines that contain specified words in multiple files? (60%)
How to delete all lines containing specific word in specific column? (59%)
How to extract all lines that contain specified words or phrases? (59%)

Check Demo of Replace text in multiple files
Keywords:
multipe files  explorer  leave  second line  blank  find  copy  second  containing  between  copy text between  containing between  replace certain word  add top  insert line multiple files word  copy text from multiple files  insert a blank line batch  certain line