After you upload the file, use this:
<cffile action="read" file="/web/wengsci/web/tabtext.txt" variable="fileData">
<cfset fileData = Replace(fileData, Chr(9), "," , "ALL")>
<cfset wantedRows = ArrayNew(1)>
<cfset allRowsArray = ListToArray(fileData, Chr(13)&Chr(10))>
<cfset i = 1>
<cfloop condition="i LTE ArrayLen(allRowsArray)">
<cfif ListLen(allRowsArray[i]) GE 3 AND
ListGetAt(allRowsArray[i],3) CONTAINS "@">
<cfset ArrayAppend(wantedRows,allRowsArray[i])>
</cfif>
<cfset i = i + 1>
</cfloop>
On 2/10/06, dave <[EMAIL PROTECTED]> wrote:
> When doing either I get a error saying I can't convert a simple value to a
> complex value, so I will start from scratch, if you wanna help cool if not
> thats cool too and thanks either way.
>
> a short copy of the files I will have to work with www.jamwerx.com/text.TAB
>
> first I upload it:
> <cffile Action="upload"
> Filefield="FileContents"
> DESTINATION="#request.perge#temp.txt"
> Nameconflict="overwrite"
> accept="text/plain, application/x-tab-delimited, application/tab,
> application/octet-stream">
>
> then I read it:
> <cffile action="read" file="#request.perge#temp.txt" variable="fileData">
>
> then I replace the tabs:
> <cfset fileData = "#Replace("#fileData#", "#Chr(13)#", ",", "ALL")#">
> <cfset fileData = "#Replace("#fileData#", "#Chr(9)#", "," , "ALL")#">
>
> to see that list do a simple loop:
> <cfloop index="i" list="#fileData#" delimiters="#chr(10)##chr(13)#">
> <cfoutput><li>#i#</li></cfoutput>
> </cfloop>
>
> Its at this point that I'm getting stuck, if i then try to go listtoarray it
> errors as well.
--
CFAJAX docs and other useful articles:
http://jr-holmes.coldfusionjournal.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231878
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54