here is a script I wrote to do it..It may not be the best way, but it does 
the job.

It is set for data with the first row containing field names


<cffile action="READ" file="C:\WINDOWS\Desktop\tabdelimiteddata.txt" 
variable="text">



<cfset text="#replace(text, '#chr(10)#' , "#chr(9)#  #chr(10)#","all")#">
<!---  <cfoutput>#textt#</cfoutput> --->

<cfset endrecord=#find(#chr(10)#,"#text#")#>



<cfset fields=#left(text,#endrecord#)#>


<form action="userdata_2.cfm" method="POST">
<cfset end=#find(#chr(9)#,"#fields#")#>
<cfset field=#left(fields,#end#)#>
<cfoutput> #field#  image------><input type="Hidden" name="f1_name" 
value="#field#"> <select name="f1" value="sample"><option 
value="yy">yy</option>
<option value="dd">dd</option>
<option value="ee">ee</option></select><br><br></cfoutput>
<cfset cnt2=0>



<cfloop condition="end is not 0">
<cfset start=#end#+1>
<cfset prestart=#end#>
<cfset end=#find(#chr(9)#,"#fields#",#start#)#>

<cfset lng=#end#-#prestart#>
<cfif #lng# gt 0>
<cfset field=#mid(fields,#start#, #lng#)#>
<cfoutput> #field#  image------><input type="Hidden" name="f_name" 
value="#field#"> <select name="f2" value="sample"><option 
value="yy">yy</option>
<option value="dd">dd</option>
<option value="ee">ee</option></select><br><br></cfoutput>
</cfif>
</cfloop>
<input type="Submit">
</form>
<br><br><br>





<cfset cnt=0>
<cfloop condition="endrecord is not 0">
<cfset cnt=#cnt#+1>
<cfset nextstart=#endrecord#+1>
<cfset previousstart=#endrecord#>
<cfset endrecord=#find(#chr(10)#,"#text#",#nextstart#)#>

<cfset lngth=#endrecord#-#previousstart#>
<cfif #lngth# gt 0>
<cfset fields=#mid(text,#nextstart#, #lngth#)#>

</cfif>


<cfset end=#find(#chr(9)#,"#fields#")#>
<cfset field=#left(fields,#end#)#>
<cfoutput> #field#  <br></cfoutput>
<cfset cnt2=0>


<cfloop condition="end is not 0">
<cfset cnt2=#cnt2#+1>
<cfset start=#end#+1>
<cfset prestart=#end#>
<cfset end=#find(#chr(9)#,"#fields#",#start#)#>

<cfset lng=#end#-#prestart#>
<cfif #lng# gt 0>
<cfset field=#mid(fields,#start#, #lng#)#>
<cfoutput>#field#   <br></cfoutput>
</cfif>
</cfloop>







</cfloop>

<cfoutput>#cnt# records found with #cnt2# fields</cfoutput>



At 12:49 PM 7/20/2000 -0700, you wrote:
>Is there a way to get CFFILE ACTION="Read" to
>recognize tabs and carraige returns within a file as a
>delimiters?  I haven't had any luck trying to parse
>out a tab delimited file because all the tabs and
>carraige returns collapse into white spaces.  Please
>help someone.
>
>__________________________________________________
>Do You Yahoo!?
>Get Yahoo! Mail � Free email you can access from anywhere!
>http://mail.yahoo.com/
>------------------------------------------------------------------------------
>To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or 
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
>the body.


------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/fusebox or send a message 
to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to