CSV creation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?bXVzb3NkZXY=?=

    CSV creation

    Hi

    I've written some code to generate a CSV file from a database table.
    However, some colums are getting broken up into 2 fields, or truncated - I
    think cos they have comma in, and of course commas are used as field
    seperators.

    How can I ensure that my fields stay in tact?!

    Thanks
  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: CSV creation

    The norm is to surround text fields with quotes, so they do not break on
    commas inside the field.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog


    or just read it:


    *************** *************** **************
    | Think outside the box! |
    *************** *************** **************
    "musosdev" <musoswire@comm unity.nospamwro te in message
    news:70D73624-F6E4-480F-B0A1-47AEC2C437CB@mi crosoft.com...
    Hi
    >
    I've written some code to generate a CSV file from a database table.
    However, some colums are getting broken up into 2 fields, or truncated - I
    think cos they have comma in, and of course commas are used as field
    seperators.
    >
    How can I ensure that my fields stay in tact?!
    >
    Thanks

    Comment

    • =?Utf-8?B?bXVzb3NkZXY=?=

      #3
      Re: CSV creation

      Thank you both - problem solved!

      "Cowboy (Gregory A. Beamer)" wrote:
      The norm is to surround text fields with quotes, so they do not break on
      commas inside the field.
      >
      --
      Gregory A. Beamer
      MVP, MCP: +I, SE, SD, DBA
      >
      Subscribe to my blog

      >
      or just read it:

      >
      *************** *************** **************
      | Think outside the box! |
      *************** *************** **************
      "musosdev" <musoswire@comm unity.nospamwro te in message
      news:70D73624-F6E4-480F-B0A1-47AEC2C437CB@mi crosoft.com...
      Hi

      I've written some code to generate a CSV file from a database table.
      However, some colums are getting broken up into 2 fields, or truncated - I
      think cos they have comma in, and of course commas are used as field
      seperators.

      How can I ensure that my fields stay in tact?!

      Thanks
      >
      >

      Comment

      Working...