cfloop comma delimited file list to sql table
<CFFILE ACTION="READ" FILE="C:\inetpub\wwwroot\synonyms\Words.txt" VARIABLE="myList">
Each line of mylist contains Title with 5 related synonyms:
Abandon: Desert,Forsake,Leave,Quit,Abdicate
Abate: Diminish,Decrease,Reduce,Lessen,Subside
Abhor: Hate,Detest,Loathe,Despise,Execrate
Ability: Capacity,Skill,Talent,Expertise,Proficiency
Okay, here's my code that does not work:
<cfloop list="#myList#" delimiters=":,">
<cfquery name="qinsert" datasource="LESSONS">
Insert Into English_Words
(Title, SYN_01,SYN_02,SYN_03,SYN_04,SYN_05)
values('#Title#', '#SYN_01#', '#SYN_02#', '#SYN_03#', '#SYN_04#','#SYN_05#')
</cfquery>
</cfloop>
The result should actually ook like the table screenshot above.
I manually added the screenshot columns in the table just to demonstrate what I am trying to do. The text file with the synonums will contain about 1000 TITLE entries, obviously too long to enter manually, and I will need to add more later.
But no matter what I try there's always an error.
I am obviously a novice at this. I am using this to teach language skills.
Please correct my code so the result will look like my photo. Please help, i really need this.
