Splitting a text file?
I have a large text file containing structured data. What I need to do, is splitting it up to save it as a new document every fifth line.
I hav a master file "Main.txt" containing he following
and so on, about 1500 times.
I need it to become
and so on till
Does anybody know a FREEWARE tool to do this?
(I' ve tried "Replace Pioneer" all ready but I cant get it to work for some reason)
A Macro for MS Office 2007 would also work, if there is any...
@ Richard C
I searched for "split file" or sth.like that here with the Yahoo Answers search engine and it came up with a question similar to mine. There it was recommended to use the mentioned tool.
Thanks for the script, but could you explain how to use it? I'm using Windows Vista; Python is installed, but I'm not familiar with it.
I put the script into a .py-file but how to go on now?
Ich weiss noch nicht wie gross es effektiv wird, ich habe es noch nicht erstellt, wenn ich keinen Weg finde es später aufzusplitten, muss ich eh eine andere Lösung suchen.
I did so, and a black window was flickering, but nothing else happened.
- Anonymous1 decade agoFavorite Answer
I wrote it really quickly in 17 lines of Python:
Edit: To use it, put it in the same directory as Main.txt and then run 'python split.py' it will write out a bunch of files named File1.txt, File2.txt etc.
- 1 decade ago
If you're working in a Unix-based system you can use the split command from a terminal window.
split -l 5 -d -a 4 Main.txt File
...would split the file "Main.txt" into a bunch of 5-line files with file names like "File0000", "File0001", etc.Source(s): http://unixhelp.ed.ac.uk/CGI/man-cgi?split
- 1 decade ago
What kind of FREEWARE tool were you expecting to find? "Text-splitter-into-separate-files-based-on-numerical-text-suffix"? Why would searching for "Replace Pioneer" give you the result you're looking for?
Sounds like you need to create a simple perl script to do this.
- ninin1922Lv 71 decade ago
erst mal ne frage -- wieviel schaut da heraus ? - ueber 1 k