Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

952.Text file parser -- How to remove first 8 rows and extract column 5 and 8 into different files?

User: maadi -- 2012-05-26          << 951  953 >>
Hits: 1735
Type: Text file parser   
Search all Text file parser examples
Description:
I have ten thousands text files. Each includes 9 columns.
I want to delete 8 first rows of all files. Then after deleting 8 rows I want to delete all columns but the 5th and the 8th columns and save them in two new separate text files. So after this operation I will have 20,000 files. 10,000 including the 5th columns and another 10,000 including the 8th columns.
thank you

Input Sample:
r1
r2
r3
r4
r5
r6
r7
r8
c1 c2 c3 c4 c5 c6 c7 c8 c9
Output Sample:
one file should include 5th column
c5


Another file should include 8th column
c8
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Suggest to finish the tasks with 3 steps:
1. remove first 8 rows/lines, please check following example:

How to delete the first 1-10 lines in many files? 
http://www.mind-pioneer.com/services/615_Advanced_search_and_replace.html

2. extract column 5, check following example:
How to extract the 7th column from text files with 8 columns?
http://www.mind-pioneer.com/services/676_Advanced_search_and_replace.html

3. extract column 8, similar as step 2.

Similar Examples:
How to extract the forth column in the second line from different files? (66%)
How to save specified lines of text file into different files? (64%)
How to remove the first 10 characters of each line in text file? (64%)
How to remove first number in each line for multiple files? (62%)
How to replace certain column from different files?  (60%)
How to remove/delete first column for multiple files? (59%)
How to delete the first word in each line in a text file? (59%)
How to remove everything after the first comma in each line in a text file? (57%)

Check Demo of Text file parser
Keywords:
110  615  7th column  task  5th  similar  include  delete the first  extract column  extract colum  delete 8th column  delete two columns  remove two columns  extract different files  extract all lines from text file to another file  remove first two lines  delete first two  deleting lines