Hi - I have a text file in the below format:

999|No Group Assigned                   |
AC |Activity                            |
BF |Brain Food                          |
BT |Books On Tape                       |
etc                       |


I want to insert/update this into a database table with field names
GroupCode and GroupDesc

so that for example
999 is inserted/updated into GroupCode
and No Group Assigned is inserted/updated into GroupDesc    etc etc

So (I presume) I want the text file in this format so that it can be 
inserted/updated
999, No Group Assigned
AC, Activity
BF, Brain Food
BT, Books On Tape
etc

I can't work out to get the text file into the second format
I have got this far:

<!--- CF reads the file --->
<CFFILE action="READ" file="d:\InetPub\wwwroot\abc\Database\copy of 
group.txt" variable="group">


<cfset CRLF="#CHR(13)##CHR(10)#">
<!--- Loop thru each line --->
<CFLOOP index="line" list="#group#" delimiters="#CRLF#">
<!--- Loop thru each word --->
<CFLOOP index="word" list="#line#" delimiters="#CHR(124)#">
<cfoutput>
#word#<BR>
</cfoutput>
</CFLOOP>
</CFLOOP>

But this does not give me what I need

Can anybody help please (I am rather lost here)
MTIA
Seamus


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to