Here is an example although not perfect and fully tested.

<cfset input = "01/01/2006 Sun 02:02AM LST -0.7 L 08:35AM LST 3.1 H 03:01PM
LST -0.4 L 08:53PM LST 2.1 H">
<cfset i2 = listtoarray( listrest( listrest( input, ' ' ), ' ' ), ' ' )>
<cfset date = listfirst( input, ' ' )>
<cfset len = arraylen( i2 )>
<cfloop from="1" to="#len#" index="i" step="4">
    <cfset time = i2[i]>
    <cfset level = i2[i+2]>
    <cfset height = i2[i+3]>
    <cfoutput>
    #date# -- #time# -- #level# -- #height# <br />
    </cfoutput>
</cfloop>


On 4/26/06, Emmet McGovern <[EMAIL PROTECTED]> wrote:
>
> Hey people.  I'm trying to parse a line to stick into a db.  This has been
> furrowing my brow for over an hour now. :)
>
> Does anyone know an easy way to turn this line...  Sometimes it's a line
> with a 4 time pattern and sometimes only 3.
>
> 01/01/2006 Sun 02:02AM LST -0.7 L 08:35AM LST 3.1 H 03:01PM LST -0.4 L
> 08:53PM LST 2.1 H
>
> Into this
>
> DATE            TIME            LEVEL           HEIGHT
> ------------------------------------------
> 01/01/2006      02:02AM -0.7            L
> 01/01/2006      08:35AM 3.1             H
> 01/01/2006      03:01PM -0.4            L
> 01/01/2006      08:53PM 2.1             H
>
>
> Much Thanks,
> Emmet
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238838
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

Reply via email to