If you're trying to parse a text file line by line, it's typically done by
looping over the file, as a list, using an appropriate EOL character(s) as
the delimiter. In this case I'll use ASCII character 13, the carriage
return.
Try something like this (if it's what you need):
<CFSET int_count = 0>
<CFLOOP List="#FileContents#" Delimiters="#Chr(13)#" Index="idx">
<CFSET int_count = (int_count + 1)>
<CFOUTPUT>
<!--- 'idx' will be a line of the file --->
<!--- Ex. Line 1: This is the first line.
Line 2: This is the second line. --->
Line #int_count#: #idx#<br>
</CFOUTPUT>
</CFLOOP>
Steve
-----Original Message-----
From: Martin S [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 12, 2000 11:04 PM
To: CF-Talk
Subject: Re: String manipulation
Thanks for that,
I know most of the string functions...but how do I do a mid
(string,start,end) which starts at the beginning of a line, and gets a copy
of the complete line...and then repeat this for every line in the text
file?? I guess i don't know how I can determine thevales for the start, end
params.
Any ideas?
>From: "Joseph Thompson" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: Re: String manipulation
>Date: Tue, 12 Dec 2000 17:05:39 -0800
>
> > It would be great if you could help me out..give me some sample
>code..names
> > of functions taht I will need to do this..or all of the above..thanks
>:-)
>
>These are what I call the "string operator" functions. You will need most
>of these.
>http://cfhub.com/language/INDEX.CFM?Cat=String%20Operators
>
>Also, pull the whole file with CFHTTP, and save it. then just use CFFILE
>for
>the rest.
>
>Of particular interest are the Find() and mid() functions.
>
>This is a script that pulls/parses data:
>http://cfhub.com/advanced/cfhttp/post.cfm
>
>and I have many more : ) Parsing is kind of a hobby of mine...
>
>If you like, email me off list...
> [EMAIL PROTECTED]
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists