Re: One question about list parsing
I'd read the contents of the text file into a list using \n as the delimiter. Then I would loop through the list of lines. At the beginning of each iteration of the loop I would use ListToArray() to build an array holding ReceiptNo and Cust_Code. Then update something like this. update table customer set receiptNo = '#myArray[1]#' where Cust_Code='#myArray[2]#' -- Ric Smith - Original Message - From: aslam bajaria <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 03, 2000 3:04 PM Subject: One question about list parsing > I have the following task to do: > > I have a list that is like > > 1, abc, > 747466464, jdj, > 484848848, utd, > > ... and so on. > > What I have to do is write a script that looks like: > > update table customer > set receiptNo = '11' > where Cust_Code='abc' > > update table customer > set receiptNo='747466464' > where Cust_Code='utd' > > ... and so on. > > The list is a text file. Is there a way to parse this > list by saying that whenever it encounters ','(comma) > sign, goto where clause, then for the second ',' sign > goto the set clause. > > What is the best way of parsing the file if there was > no comma. Supposing the list was like: > > 11 abc > 7474664564 xyz > > etc. > > Is there a built in function in ColdFusion to parse > the list in this way. > > Appreciate it. > A Bajaria > > __ > Do You Yahoo!? > Talk to your friends online with Yahoo! Messenger. > http://im.yahoo.com > -- > Archives: http://www.eGroups.com/list/cf-talk > To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: One question about list parsing
i would use somehting like this... UPDATE customer SET receiptNo = '#fred[bob-1]#' WHERE Cust_Code = '#fred[bob]#' that should do you. of course, change variable names as you see fit. :) Chris Olive DOHRS Website Administrator [EMAIL PROTECTED] -Original Message- From: aslam bajaria [mailto:[EMAIL PROTECTED]] Sent: Monday, April 03, 2000 3:05 PM To: [EMAIL PROTECTED] Subject: One question about list parsing I have the following task to do: I have a list that is like 1, abc, 747466464, jdj, 484848848, utd, ... and so on. What I have to do is write a script that looks like: update table customer set receiptNo = '11' where Cust_Code='abc' update table customer set receiptNo='747466464' where Cust_Code='utd' ... and so on. The list is a text file. Is there a way to parse this list by saying that whenever it encounters ','(comma) sign, goto where clause, then for the second ',' sign goto the set clause. What is the best way of parsing the file if there was no comma. Supposing the list was like: 11 abc 7474664564 xyz etc. Is there a built in function in ColdFusion to parse the list in this way. Appreciate it. A Bajaria __ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
One question about list parsing
I have the following task to do: I have a list that is like 1, abc, 747466464, jdj, 484848848, utd, ... and so on. What I have to do is write a script that looks like: update table customer set receiptNo = '11' where Cust_Code='abc' update table customer set receiptNo='747466464' where Cust_Code='utd' ... and so on. The list is a text file. Is there a way to parse this list by saying that whenever it encounters ','(comma) sign, goto where clause, then for the second ',' sign goto the set clause. What is the best way of parsing the file if there was no comma. Supposing the list was like: 11 abc 7474664564 xyz etc. Is there a built in function in ColdFusion to parse the list in this way. Appreciate it. A Bajaria __ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.