Save multiple files (array elements) as separate files at once


I’m working on an AIR application for splitting a large text file (with extension *.SDF) into different parts and save each splitted part as different file.

The large text file in the attachment (test.SDF) is consisting of three parts (molecular information). Each part starts with a name (for example: MOX-028-030, MOX-037-030, MOX-039-030) and finishes with the line string (for example: $$$$) which means infact blank line.

Is it possible to split this large text file (into array elements) and save these three parts at once like (MOX-028-030.MOL, MOX-037-030.MOL, MOX-039-030.MOL) where the file name is the part title written in the SDF file?

Thanks in advance and best regards,