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: 2006
Type: Text file parser   
Search all Text file parser examples
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:
Peter|Washington||1234|none|likes chocolate
Output Sample:
Peter||likes chocolate
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 extract all specified links from a html file? (65%)
How to batch extract specified lines from a text file? (65%)
How to extract multiple fields from data file and create a csv file? (64%)

Check Demo of Text file parser
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