Parsing text files using Coldfusion
Posted on 2007-11-23
How can I parse through a directory of text files, some with different formatting, and grab key information using Coldfusion? The ultimate goal is to get all the key information from the fields below into csv spreadsheet. Though the formatting varies the fields I want to capture the information for are:
Here is an example text file:
******* Example Start *******
Sent: Saturday, June 17, 2007 4:28 PM
Subject: My best photos
Student photo submission
Name=Photo by John Doe
School= Some School
Description=This is my trip to DisneyLand June 17, 2007.
Photo name: IMG_39587.jpg
******* Example End ******
NOTE: Some of the files do not contain all the fields and some contain other information that is not wanted in the final table.