Create a structure Record=StructNew(). 

Create each empty column, Record["UR"]="";Record["AA"]="" etc. 

Read the file line by line. 

If a blank line then use a query to write your structure to the db. 

If not, then the Column = ListFirst(CurrentLine, "|"), content =
ListRest(CurrentLine, "|").
Append the data to your structure: Record[Column] =
ListAppend(Record[Column], Content, " ");

Does that help any?

> -----Original Message-----
> From: Seamus Campbell [mailto:[EMAIL PROTECTED]]
> Sent: mercredi 3 juillet 2002 11:42
> To: CF-Talk
> Subject: parsing question
> 
> 
> Hi
> I hope someone can help me.
> I have a txt file (copy of a small portion of it below) that 
> I need to be 
> able to output into a database.
> I'm reading it via cffile but am unsure how to get it into a 
> useable format 
> ie delimiters etc
> The letters before the pipe are column headings (that's prob obvious)
> 
> If anyone could help I would be grateful.
> 
> 
> UR|BC51
> AA|
> AI|
> TI|MARG - A MAGAZINE OF THE ARTS. Appreciation of the Creative
> TI|Arts under Maharaja Ranjit Singh.
> PU|Oxford University Press
> PP|Sydney
> DP|n.d.
> NT|Colour and b/w plates, including some folding, 93pp, 4to,
> NT|light soiling boards, a good copy.
> NT|Articles on the arts during the reign of Maharaja Ranjit
> NT|Singh.
> ED|
> BD|
> PR|35.00
> KE|Art
> KE|India
> KE|Periodical
> KE|South Asia
> XA|4
> XB|1
> XC|BO
> XD|S
> 
> UR|BC117
> AA|`ABD AL-LATIF AL-BAGHDADI.
> AI|
> TI|The Eastern Key. Kitab Al-Ifadah Wa'l-I`Tibar.
> PU|Allen and Unwin.
> PP|
> DP|1965.
> NT|Trans. 293pp, index, biblio., Arabic and English text, covers
> NT|trifle flecked and worn.
> NT|
> ED|
> BD|
> PR|35.00
> KE|Biography
> KE|Middle East
> KE|Philosophy
> KE|Science
> XA|4
> XB|1
> XC|BO
> XD|S
> 
> UR|BC1147
> AA|BARTLETT, ANDERSON G. ET. AL.
> AI|
> TI|Pertamina. Indonesian National Oil.
> PU|Amerasian.
> PP|Djakarta.
> DP|n.d. (c.1972).
> NT|Endpaper maps, ill, xi + 420pp, appendices, selected
> NT|biographies, biblio, index, d/j little worn, nice copy.
> NT|History of Pertamina, including chapters on 1965 coup, the
> NT|New Order, and negotiations with multinational companies.
> ED|
> BD|
> PR|40.00
> KE|Economics
> KE|History
> KE|Politics
> KE|South East Asia
> XA|4
> XB|1
> XC|BO
> XD|S
> 
> 
______________________________________________________________________
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

Reply via email to