Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

226.Text file splitter -- How to split files by columns with fixed widths, and save to files with sequence?

User: editor -- 2008-07-17          << 225  227 >>
Hits: 699
Type: Text file splitter   
Search all Text file splitter examples
Description:
How to split files by columns with fixed widths, and save to files with sequence?
Input Sample:
File.txt:

Kap1Scl000921.0-275916 5.42
Eps Phe000924.7-454451 3.88
aaa Psc001002.3+110844 5.51
bbb And001019.3+460420 5.03
Output Sample:
File1.txt
Kap1
Eps
aaa
bbb

File2.txt
Scl
Phe
Psc
And

File3.txt
000921.0
000924.7
001002.3
001019.3

File4.txt
-275916
-454451
+110844
+460420

File5.txt
5.42
3.88
5.51
5.03
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
In this case, column widths of each column are: 4,3,8,7,-2,4
Note: -2 means skip by 2 characters.

Procedures:
1. ctrl-o open source text file
2. ctrl-h open 'Replace' dialog

* set "output file"(at right bottom) to filename with full path like 
* set ">" symbol to "<<< Split by column" to the left of output file.
* click 'settings' page:
set 'Split naming' to:


check option of '[v]Max word length' and enter the length value as:


3. click 'Replace', file will be splited to File1.txt, File2.txt, ...

Note: if "Max word length" is set, the columns will not be delimitered by default spaces, they are delimitered by fixed widths specified here.
Download Script:  scripts/226.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Settings_Window


Similar Examples:
How to split file by columns, and save each column as file a001.txt, a002.txt, ...? (55%)
How to split a file by every 100 lines, and put every 50 files into one folder? (54%)
How to batch split files into columns that separated by comma? (52%)
How to join hundreds of columns in different files into one csv file? (51%)
How to insert two columns into a database file separated by "|"? (51%)
How to split a text file into multiple files evenly on size? (50%)
How to multiply the first column with the rest of columns in one file? (50%)
How to remove/delete first column for multiple files? (49%)

Check Demo of Text file splitter
Keywords:
split files by columns  skip  split naming  naming  length  path  max  symbol  fixed  sym  text split fixed widths  split fixed text file  fixed length column file splitter  split fixed length text file  fixed sequence  split fixed length file  filename length  split text file by columns