Peter,
I'm not too sure I follow what the big problem is with loading this into
SQL? Can't you loop over the string using CRLF as the row delimiter and
the pipe as the column delimiter?
You will have problems if there is a null list element obviously, given
ColdFusion ignores empty list elements. Usually doing a pre-check for
"empty" column values and replacing them with "{empty}" or something works
quite well.
However, I would recommend using SQL Server and a scheduled DTS package if
you can at all help it (or can do it). Do you know how many rows you will
be importing?
Darryl Lyons
[EMAIL PROTECTED] wrote on 18/01/2005 05:15:44 PM:
> Any ideas on parsing this from a flat text file (.txt) into a database
> (assuming row one in file is column name?).
>
> Sample data:
>
>
SUPPLIER|CAT.|PRODUCT-CODE|DESCRIPTIONS|LQ|MQ|HQ|LQ-PRICE|MQ-PRICE|HQ-PRICE|
> RRP(INC-TAX)|STOCK|WEIGHT|G-CODE
> 4KUS |CD|CCD-52X6D |52X CD-ROM DRIVE RETAIL PACK
> |9|19|999|16.7|16.6|16.5|23.99|YES|1|09013
> 4KUS |MO|CDR-7S52
> |INT.CRW,52xCDR,32xCDRW,52xCD-READ,NERO5.5,SMART-BURN/X,VAS
> |9|19|49|31|30.75|30.5|44.99|YES|1|14392
>
> As you can see the end of the row is not "terminated" and the usual
> delimiter of the comma "," is used within certain fields so bugger the
easy
> parsing using the CFML default comma.
>
> I am assuming the the COLUMN NAMES are not valid and would have to be
> tweaked on the fly (that is easy).
>
> I am also assuming that ALL fields are populated although NULL data
could be
> accepted.
>
> I have done similar conversions only recently but with a known
delimiter.
> Any ideas on the most efficient way to do this using ColdFusion MX 6.x.?
> Please?
>
> Regards,
>
> Peter Tilbrook
> Director, ColdGen Internet Solutions
> Manager, ACT and Region ColdFusion Users Group
> Director of Technology, Global Information Exchange
> 4/73 Tharwa Road
> Queanbeyan, NSW, 2620
> AUSTRALIA
>
> WWW 1: http://www.coldgen.com/
> WWW 2: http://www.actcfug.com/
> Telephone: +61-2-6284-2727
> E-mail: [EMAIL PROTECTED]
>
> >>
>
> All of my external emails are scanned for viruses using the latest
available
> Norton AV signatures. Also I do NOT maintain an Address book or Contact
list
> to minimise the risk of infecting recipients of my messages for viruses.
I
> also prefer "plain text" emails for speed and efficiency.
>
> Powered by Lookout:
>
> Lookout is lightning-fast search for your email, files, and desktop
works
> with Microsoft Outlook.
>
> http://www.lookoutsoft.com/Lookout/
>
> >>
>
>
>
>
> ---
> You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
To unsubscribe from this email please forward this email to [EMAIL PROTECTED]
This email message is confidential and may be privileged. If you are not the
intended recipient
please forward the email to [EMAIL PROTECTED] and delete the original.
ABN AMRO Morgans Limited and its associates hold or may hold securities in the
companies/trusts mentioned herein.
Any general advice included in this email has been prepared without taking into
account your objectives, financial situation or needs.
Before acting on the advice, you should consider its appropriateness or discuss
with one of our investment advisors.
ABN AMRO Morgans Limited (ABN 49 010 669 726 AFSL 235410) A Participant of ASX
Group.
A principal member of the Financial Planning Association.
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/