I currently have to use editor to manually split a file & would like a script to faciliate
the splitting such I can just run :
./splitting_script Inputfile
There's a separator that tells us where to split the Inputfile.
A file with 3 separators will be split into 3 files,
a file with n separators will be split into n files.
Eg of an Inputfile:
record1 .....
record2 .....
...............
recordX
<YYYYMMDDhhmm_abcd> <== this is a separator
recordX+1
........
recordY
<YYYYMMDDhhmm_abcd> <== this is another separator
recordY+1
........
recordZ
<YYYYMMDDhhmm_abcd> <== this is the last separator
where YYYYMMDD is the numeric date, hhmm is hour_minute
while abcd is a variable number (can be a 3 or 4 or 5 digit number).
Since the date, time & variable number are non-constant,
the <......> is the separator to look for.
So in the above example, the InputFile would be split into the 3 files below :
File1:
====
record1 .....
record2 .....
...............
recordX
<YYYYMMDDhhmm_abcd>
File2:
====
recordX+1
........
recordY
<YYYYMMDDhhmm_abcd>
File3:
====
recordY+1
........
recordZ
<YYYYMMDDhhmm_abcd>
Our community of experts have been thoroughly vetted for their expertise and industry experience.