Hi,
There is no easy way to import this stuff.
Do you know if each record is delimited CRLF? I notice the record is
not all one line.... are the extra lines due to CR's?
I guess you could loop over each record (by CRLF) and the data in
between you put in a list using the pipe "|" as the delimiter..... then
trim those bits... and strip out any other carrigage returns.
very slow.... but people do insist on sending this rubbish out for
use.
cheers,
>>> [EMAIL PROTECTED] 18/01/2005 6: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/
---
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/