Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

969.Text file parser -- How to extract specified columns from a large pipe separated csv file?

User: Frank Koppensteiner -- 2012-07-12          << 968  970 >>
Hits: 4361
Type: Text file parser   
Search all Text file parser examples
Description:
I have a TXT/CSV - File using "|" (Pipe Symbol) as a Field Separator. There are about 1500 columns, I only need about 130 in a new file.  
I want to specify the source file, the used field (column) separator and the field (column) names for the columns I need in the target file. If it´s easier to look for the x-th occurence of the separator, I could also specify the column number instead of the column name, se example: Name, Mail, Extra or 1,3,6. Attention: Source file size is about 60 MB(!)
Input Sample:
Name|Address|Mail|Phone|Info|Extra 
Peter|Washington|pete@xy.com|1234|none|likes chocolate 
Amy|Detroit|amy@ab.com|9876|lalala|empty 
Henry|Nashville|hh@nv.com|4567|musician|country
Output Sample:
Name|Mail|Extra 
Peter|pete@xy.com|likes chocolate 
Amy|amy@ab.com|empty 
Henry|hh@nv.com|country 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open the csv file, need wait for a while if size is large 
2. ctrl-h open 'replace' dialog 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
3. click 'replace', done! 
4. ctrl-s save to a new file.

Screenshot 1:  Replace_Window


Similar Examples:
How to extract specified lines in multiple excel(csv) files? (69%)
How to replace the second column in a tab seperated file? (68%)
How to extract specified columns from blocks of text? (67%)
How to extract specified lines in different section of text file? (66%)
How to extract the second column from a database text file? (66%)
How to replace specific column with specific rule in csv file? (65%)
How to extract all specified links from a html file? (65%)
How to batch extract specified lines from a text file? (65%)

Check Demo of Text file parser
Keywords:
occurence  pipe  about  file size  size  500  field  mail  e mail  tea  extract field from large csv file  extract columns csv file  extract columns from csv file  extract field  extract column from csv  csv extract column  extract column csv  extract columns