Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

501.Replace text in multiple files -- How to remove the last 3 lines of multiple text files all at once?

User: editor -- 2010-05-08          << 500  502 >>
Hits: 3162
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
How to remove the last 3 lines of multiple text files all at once?
There are some text files with many lines, how to remove the last 3 lines of each file in batch mode?

Input Sample:
some txt files like:

file1.txt
file2.txt
file3.txt
file4.txt
...
Output Sample:
new txt files with last 3 lines removed:
file1_new.txt
file2_new.txt
file3_new.txt
file4_new.txt
...

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 txt files from "Windows File Browser" to "Batch Runner" window
* check output filename option, and change the following entry to:

3. click 'Fast Replace' button
(1) click "Add"
* in "search" entry, enter: 

* leave "replace" entry blank
(2) check option of "Regular Exp"
(3) click "Start" button, done!

Similar Examples:
How to remove the line 10 to 20 from many text files all at once? (76%)
How to move the last line to the beginning for multiple text files? (74%)
How to remove/delete extra blank lines in multiple text files? (73%)
How to remove leading spaces and tabs in each line in multiple text files? (71%)
How to extract the last non-blank line from multiple text files? (70%)
How to convert many html files to text files all at once? (69%)
How to remove duplicate lines from a text file? (68%)
How to extract last 100 lines from multiple files? (67%)

Check Demo of Replace text in multiple files
Keywords:
leave  mode  blank  the last  last  las  base  regular  regula  regular exp  remove multiple last lines  remove text from many text files at once  remove last 3 lines  last lines remove  remove last lines  remove last 3 lines in text file  remove lines of text from multiple files batch file  remove text from filename with batch file