Greetings,
I'm seeking and needing help in writing a alias to split up a huge text file. It contains 100,000 entrys, 1 entry per line, 100,000 lines in length into files containing 1 entry per line 5,000 entrys total, 5,000 lines in length.
Ideally, the alias would also incorporate a generated number with the output text filename generated for each 5,000 entrys stored, ie text1.txt, text2.txt
Here is a snippit of one of my crude attempts to just pull off the first 5,000 entrys, but its not working:
alias TextSplitter {
set %Textnumb 1
set %Textnum 5000
:next
if (%Textnumb > %Textnum) { /goto finish }
set %info $read(C:\1Report\text.txt,%Textnumb)
.write C:\1Report\text1.txt %info
set %info $null
inc %Textnumb
goto next
:finish
}
Again, this crude attempt of mine doesn't include any updating of the output filename and was just my attempt to peel off the top 5,000 entrys as a example here.
Thanks to each for your comments and suggestions,
MDA