Forum Moderators: coopster

Message Too Old, No Replies

My Data Contains Commas and pipes "¦"

Now what do I use to delimit columns?

         

MrSpeed

5:42 pm on Mar 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have some raw data that I was planning to insert into a flat file and then upload/insert into my mySQL DB.

However the data contains commas and pipes "¦". I usually use the ¦ as my delimiter.

Before I upload the data I wanted to remove dupes which happen to be text/blob fields. I usually do this in access.

I thought I could get around this by using quotes as a text qualifier. It didn't seem to work. My other method I usually try is to use some combination of characters like <¦¦> as a delimeter.

However Access only allows one character as a delimeter and phpmyadmin only allows two characters as the delimeter.

Any ideas how to work around this?

jatar_k

3:57 am on Mar 11, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you can really use any character that won't be in your data to delimit it.

tab
@
;

whatever, doesn't matter that much but all depends on what you have in the data itself.

httpwebwitch

9:57 pm on Mar 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If nothing else works, try the tilde.

~

No one ever uses it except in dumb user directory URLs and cute e-mail signatures.

Or you could test the range of valid characters by using one of those funny foreign letters:

ø ÿ ñ ¥ ¿

If you're dealing with HTML-bound text, try changing your commas into entity characters before storing them:

"," => "&#44;"

... then use commas as your delimiter. When the text is displayed, your "&#44;" is changed back into a ","

Good luck!