forums › forums › SQLyog › Using SQLyog › Export Csv And Null
- This topic is empty.
-
AuthorPosts
-
-
September 1, 2005 at 1:09 pm #9198linrocMember
Hi,
i am trying to export some data to an csv file – but i keep getting null in the csv file.
I would like my csv to look something like this:
field1 ~ field2 ~ field3
a ~ b ~c
d ~ ~e
f ~ ~g
and so on – how should my export setup look like ??
/corlin
-
September 1, 2005 at 4:47 pm #19085RiteshMember
You will need to export it in FIXED LENGTH format.
-
September 1, 2005 at 6:36 pm #19086linrocMemberRitesh wrote on Sep 1 2005, 06:47 PM:You will need to export it in FIXED LENGTH format.[post=”7053″]<{POST_SNAPBACK}>[/post]
Thanks for the reply, but how can i combine fixed length and a ~ delimiter (seems like opposites 🙁 )
/Claus
-
September 1, 2005 at 7:39 pm #19087peterlaursenParticipant
I can generate this output
Quote:1~2004:07:23 09:32:50~~~2~2004:07:23 12:39:56~~~
3~2004:07:23 12:47:58~~~
4~^N~69935e452ad050b7bc904cca7691694b~^N~^N
7~^N~d347c0437fe7bc1be23571f0e6177e19~^N~^N
9~^N~e1259f8fcecabc833cff6b531a81d535~^N~^N
11~^N~c3818847c1eb36f00df27708752dcf21~^N~^N
241~2004:07:23 09:00:00~~~
243~2004:07:23 09:52:44~~~
248~2004:07:23 08:33:22~~~
etc
from the data and the export settings below.
Now a search for '^N' and replace with '' in a texteditor, and you got what you want.
If the escape character is not used I get
Quote:1~2004:07:23 09:32:50~~~2~2004:07:23 12:39:56~~~
3~2004:07:23 12:47:58~~~
4~NULL~69935e452ad050b7bc904cca7691694b~NULL~NULL
7~NULL~d347c0437fe7bc1be23571f0e6177e19~NULL~NULL
9~NULL~e1259f8fcecabc833cff6b531a81d535~NULL~NULL
11~NULL~c3818847c1eb36f00df27708752dcf21~NULL~NULL
241~2004:07:23 09:00:00~~~
243~2004:07:23 09:52:44~~~
etc.
But I think it is more safe to replace '^N' than 'NULL'. Or any other crazy escape character instead of '^' that is safe to use with your data . I just tested with '|' as well and that functions the same.
-
September 1, 2005 at 7:44 pm #19088peterlaursenParticipant
BTW – don't we miss a windows standard “where to save” dialogue here ?
-
September 1, 2005 at 7:57 pm #19089linrocMemberpeterlaursen wrote on Sep 1 2005, 09:39 PM:I can generate this output
etc
from the data and the export settings below.
Now a search for '^N' and replace with '' in a texteditor, and you got what you want.
If the escape character is not used I get
etc.
But I think it is more safe to replace '^N' than 'NULL'. Or any other crazy escape character instead of '^' that is safe to use with your data . I just tested with '|' as well and that functions the same.
[post=”7055″]<{POST_SNAPBACK}>[/post]Thanks for the reply – I was hoping to avoid the text replacement – but has decided to live with it 🙂 It's a bit troublesome when having 1mill+ records 🙂
/claus
-
September 1, 2005 at 8:09 pm #19090peterlaursenParticipantQuote:I was hoping to avoid the text replacement … It's a bit troublesome when having 1mill+ records
What (the hell) do you want that astronomic .csv-file for?
If you want to transfer data to another database consider other possibilities such as OBDC-import. Life is too short for CSV. There must be other options ?!
-
September 2, 2005 at 7:02 am #19091
-
September 2, 2005 at 9:00 am #19092linrocMemberpeterlaursen wrote on Sep 1 2005, 10:09 PM:What (the hell) do you want that astronomic .csv-file for?
If you want to transfer data to another database consider other possibilities such as OBDC-import. Life is too short for CSV. There must be other options ?!
[post=”7058″]<{POST_SNAPBACK}>[/post]Agree – but my client prefers csv – and pays for it 😀
Actually i extract data from a sybase directly to mysql by sqlyog odbc – and then uses sqlyog to create the (f……) csv files – but it works and my client is happy 🙄
-Claus
PS: Per Laursen sounds danish ??
-
September 2, 2005 at 5:43 pm #19093RiteshMemberQuote:PS: Per Laursen sounds danish ??
Yes. Hez indeed Danish 🙂
-
-
AuthorPosts
- You must be logged in to reply to this topic.