0
comma Delimited file
Explorer
,
/t5/coldfusion-discussions/comma-delimited-file/td-p/258952
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
Hello,
I have a need to insert a csv file into a table. I am having a problem with the insert query, three of the 132 fields commonly have commas in the text within the field and making the query barf. Please help.
Matt
I have a need to insert a csv file into a table. I am having a problem with the insert query, three of the 132 fields commonly have commas in the text within the field and making the query barf. Please help.
Matt
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Contributor
,
/t5/coldfusion-discussions/comma-delimited-file/m-p/258953#M23031
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
You need another delimiter. There is no way to differentiate
the commas in values from the comma delimiters.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/coldfusion-discussions/comma-delimited-file/m-p/258954#M23032
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
A CSV that contains text really should use a qualifier like
double-quotes, as you can't always control what characters will be
in the data, then you won't have that issue.
You would have to modify your CF insert code or use one of the many UDFs/CFCs that already exist and can handle the qulaifier.
You would have to modify your CF insert code or use one of the many UDFs/CFCs that already exist and can handle the qulaifier.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
fyrehed
AUTHOR
Explorer
,
/t5/coldfusion-discussions/comma-delimited-file/m-p/258955#M23033
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
phil,
So, the comma delimited file which is produced from Multiple Listing Service, should be something other than comma delimited. Problem is; This software lets you have any format you want, as long as its comma delimited :). Can anyone point me to a direction of converting the comma delimited to another delimiter with Coldfusion?
Matt
So, the comma delimited file which is produced from Multiple Listing Service, should be something other than comma delimited. Problem is; This software lets you have any format you want, as long as its comma delimited :). Can anyone point me to a direction of converting the comma delimited to another delimiter with Coldfusion?
Matt
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Contributor
,
/t5/coldfusion-discussions/comma-delimited-file/m-p/258956#M23034
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
Try using "," (that is, quote-comma-quote) as the delimiter.
That of course wouldn't help if you have that string in a value
;^).
Have you tried setting up an ODBC connection to the file?
I'll get on MLS this evening and see what I can do with it.
Have you tried setting up an ODBC connection to the file?
I'll get on MLS this evening and see what I can do with it.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/coldfusion-discussions/comma-delimited-file/m-p/258958#M23036
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
quote:
Originally posted by: fyrehed
phil,
So, the comma delimited file which is produced from Multiple Listing Service, should be something other than comma delimited. Problem is; This software lets you have any format you want, as long as its comma delimited :). Can anyone point me to a direction of converting the comma delimited to another delimiter with Coldfusion?
Matt
If your csv file has a text qualifier, such tmschitt stated, you don't even have to go looking for udfs/cfcs. The cfhhttp tag can be used to create a query object and then you're off to the races. I'm not sure, but it might even work without the qualifiers.
Details are in the cfml reference manual. If you don't have one, the internet does.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
fyrehed
AUTHOR
Explorer
,
/t5/coldfusion-discussions/comma-delimited-file/m-p/258957#M23035
Aug 07, 2007
Aug 07, 2007
Copy link to clipboard
Copied
Phil,
When you say "ODBC", are you referring to setting up a datasource in the ColdFusion administrator? The administrators will not make a datasource to this file. If there is another way, please let me know.
Thanks for your help.
When you say "ODBC", are you referring to setting up a datasource in the ColdFusion administrator? The administrators will not make a datasource to this file. If there is another way, please let me know.
Thanks for your help.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

