• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

14.2. Parsing Data

As shown in the previous examples, CFHTTP is great for importing the contents of a text file into a query object and allowing for output of results to the screen. This process is useful if you want to dump the results of the file into another database or output the results to a simple HTML table. But what if the data you import requires a little cleaning up beforehand? Take, for example, the following delimited text file containing employee information for a fictitious company:

Name,Title,Department,Extension,JobCode
Joe Smith,Lead Salesperson,Sales,5515,A:001
Nancy Jones,Liaison,Marketing,5596,B:003
Tom White,Mechanical Engineer I,Engineering,5525,A:002
Jen Brown,Collection Specialist,Billing,5543,C:004
Mike Johnson,Security Guard,Security,5512,E:012


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint