I have a file which is over 400Mb
It is a timetable database which is only distributed in this way.
In this text file there is a string which marks the start of a data record.
This string always begins with "BSN", and likewise there is a string that marks the end of the data record which always starts with "LT"
What i'm trying to fathom is how to chop the data file into chunks, containing 1000 data records. then when this cycle is complete, i can import those files sequentially.
The created files must be numbered sequentially in a new folder...
[edit] the record set varies greatly in length [/edit]
Below is a sample of one of the groups:
BSNC031551112111206240000001 << DATA RECORD START >>
BX EMYEM129000
LOSHEFFLD 2235 2235
LIDORESNJ
LISPDN
LTDRBY 2326 23266 << DATA RECORD END >>
BSNC033501112111205130000001 << NEXT RECORD >>
BX EMYEM118600
*the << >> tags are added for your understanding, they do not exist in the file.
I currently read in the file using the PHP fopen / fgets method here