Hurley4540, when you say any language what does that mean?
I'm an omnimark developer and can write this in that language fairly quickly when I get off work. (Omnimark is a command line text transformation language in it's simplest form.)
I could also write this in Python or DOT.Net (C#, VB.Net, ASP.NET)
I just need to know what language you want to use. I know you said any, but I don't want to write something you'll have to download an interpreter for if you already have something installed.
JHalstead added 48 Minutes and 9 Seconds later...
Below you should find a python version of the script I think you're asking for.
Code:
#!/usr/bin/env python
inputfile = open("readerfile.txt").read() # file to read from
num = 1000 # number of lines for each output file
curline = inputfile.split("\n")
i = 0
x = 1
for items in curline:
open(str(x) + ".txt","a").write(items)
if i != num - 1 :
open(str(x) + ".txt","a").write("\n")
i = i + 1
if i == num :
x = x + 1
i = 0
Just save as split.py and run at a command line with "python split.py" this will produce "1.txt, 2.txt, 3.txt, etc..." with 1000 lines per file. Wrote this well on break at work, let me know if it works for you...
NOTE: edit inputfile path, second line in code
Bookmarks