Structures are really easy, and good to know. Basically, you just remember they are the same as arrays except you use a character string to reference each entry. And if confused you can always <cfdump> :-)
One thing I missed in that algorithm: After inserting an entry into the db you need to clear out the structure again with Record["UR"]="";Record["AA"]="" etc. > -----Original Message----- > From: Seamus Campbell [mailto:[EMAIL PROTECTED]] > Sent: mercredi 3 juillet 2002 12:45 > To: CF-Talk > Subject: RE: parsing question > > > thanks Matthew - certainly gives me a start - structures > scare me but I'll > start working on your suggestion later today > many thanks > > seamus > > At 09:57 am 3/07/2002 , you wrote: > >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 > > > > > > > > > ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.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

