Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Export Csv And Null

forums forums SQLyog Using SQLyog Export Csv And Null

  • This topic is empty.
Viewing 9 reply threads
  • Author
    Posts
    • #9198
      linroc
      Member

      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

    • #19085
      Ritesh
      Member

      You will need to export it in FIXED LENGTH format.

    • #19086
      linroc
      Member
      Ritesh 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

    • #19087
      peterlaursen
      Participant

      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.

    • #19088
      peterlaursen
      Participant

      @Ritesh

      BTW – don't we miss a windows standard “where to save” dialogue here ?

    • #19089
      linroc
      Member
      peterlaursen 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

    • #19090
      peterlaursen
      Participant
      Quote:
      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 ?!

    • #19091
      Ritesh
      Member
      peterlaursen wrote on Sep 1 2005, 07:44 PM:
      @Ritesh

      BTW – don't we miss a windows standard “where to save” dialogue here ?

      [post=”7056″]<{POST_SNAPBACK}>[/post]

      We dont require a “WHERE TO SAVE” dialogue as its COPY TO CLIPBOARD option 🙂

    • #19092
      linroc
      Member
      peterlaursen 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 ??

    • #19093
      Ritesh
      Member
      Quote:
      PS: Per Laursen sounds danish ??

      Yes. Hez indeed Danish 🙂

Viewing 9 reply threads
  • You must be logged in to reply to this topic.