I am looping over a list that contains the names of mailing lists. The
delimiter in the loop is the carriage return. I am trying to identify the
position of the first space in the index. I thought the regex for a space
was /s, but that is not working here as the REFind always returns a zero.
This is what one line of the list looks like:
BREASTCANCER 1999-12-30 0 0 0 0 0 0 0 0
and here is my code:
<cfloop list="#logfile#" delimiters="#Chr(13)##Chr(10)#" index="line">
<cfset linelength = Len(line)>
<cfset CurrentlistwordSTART = REFind('([A-Za-z]+)', line, "TRUE")>
<cfset SpacePositionAfterFirstWord = REFind('\s+', line)>
SpacePositionAfterFirstWord:
<cfoutput>#SpacePositionAfterFirstWord#</cfoutput><br>
<cfset daypositionstart = SpacePositionAfterFirstWord + 1>
<cfset daypositionend = daypositionstart + 10>
<cfset CurrentListList = Left(line, linelength)>
<cfset CurrentList = Left(line, SpacePositionAfterFirstWord -1)>
<cfset currentday = Mid(line, daypositionstart, daypositionend)>
CurrentDay: <cfoutput>#currentday#</cfoutput><br>
</cfloop>
I don't really need the currentlistwordStart variable since the word is
always the first thing on each new line. My problem is the 2nd REFind:
REFind('\s+', line), which always gives me a zero.
The files I am parsing are the ListServ log files, in case anyone is
curious. They don't have any type of log analysis available so I am trying
to create my own.
Thanks
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.