I'm attempting to build an array from .txt file. What I'd like to do is create
a new element in the array with every new line in the text file.
Now I'm reading the file like this:
<cfdirectory directory="H:\cfdev\" action="list" name="dirs">
<cfloop query="dirs">
<!--- Read that file. --->
<cffile
action="read"
file="H:\cfdev\#dirs.name[count]#"
variable="filetemp" charset="utf-8">
<!--- Turn filetemp into array --->
<cfloop from="1" to="#dirs.recordcount#" index="go">
<cfset grab = refindnocase(".*\r\n",filetemp,start,"true")>
<cfif grab.pos[1] eq 0>
<cfbreak>
<cfelse>
<cfset numb[go] = mid(filetemp,grab.pos[1],grab.len[1])>
<cfset filetemp = removechars(filetemp, 1, grab.len[1])>
</cfif>
</cfloop>
</cfloop>
But the issue I'm having is with the RegEx. For some reason CFFile strips out
the line feed characters. Anyone have a work around, or a Custom Tag for this?
--j
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212260
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54