On Tue, 18 Jun 2002 15:48:13 -0400, in cf-talk you wrote:
>On 6/18/02, Jamie Jackson penned:
>>I've got several large text files to manipulate.
>>
>>Any line that looks like this:
>>DE*MY TITLE / HERE
>>
>>I need to make into this:
>>DE*My Title / Here
>>
>>I hope there's an easier way to do this than follows:
>>1. CFFILE read the data
>>2. Loop a REFind function with "return subexpressions" on, creating an
>>array of structures of arrays
>>3. Loop the array of structures of arrays and do an "Insert" function
>>that replaces the string with a "title case" UDF
>>
>>Hmm... I just thought of a more appealing way: I could loop through
>>the file contents one line at a time, and do a CFFILE "append" to
>>another file, as I parse each line.
>
>Maybe I'm reading this wrong, but can't you just go:
>
><cffile action="read" file="myfile.txt" variable="oldcontent">
>
><cfset newcontent = replace(oldcontent, "DE*MY TITLE / HERE", "DE*My
>Title / Here", "ALL"))>
>
><cffile action="write" file="myfile.txt" output="#newcontent#">
Ahh, wouldn't that be nice. ;-) No, I should have been more explicit:
The problem is that "MY TITLE / HERE" is just an example, the string
could be like:
DE*ALMOST ANYTHING COULD
or
DE*FOLLOW THE / DE
or
DE*MARKER SO A SIMPLE
or
DE*SOLUTION / ISNT POSSIBLE
Any ideas (on how to read the data one line at a time - or another
solution)?
Thanks,
Jamie
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists