macromedia.coldfusion.getting_started
[Top] [All Lists]

Re: Parsing a tab delimited file

Subject: Re: Parsing a tab delimited file
From: "jdeline"
Date: Tue, 22 Apr 2008 08:51:35 +0000 UTC
Newsgroups: macromedia.coldfusion.getting_started

You have a list within a list.  The outer list is new-line (Chr(10)) delimited; 
the inner list is tab-delimited.  So in dealing with a new row, use <CFSET foo 
= ListGetFirst(bar, Chr(10))>

 Once you have the row in foo, you must deal with the empty list elements.  You 
can accomplish that by finding consecutive tab characters and inserting a space 
between them.  
 Something like <CFSET foo = Replace(foo, "#Chr(9)##Chr(9)#", "#Chr(9)# 
#Chr(9)#", "ALL")>.  You will want to do this twice to account for multiple 
empty list elements next to each other.

 Now you have a tab-delimited list that will work for you.


<Prev in Thread] Current Thread [Next in Thread>