Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2001
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving as csv (2000)

    I am having trouble with some files I am trying to create. I am exporting data to Excel (it goes automatically into v95). I then manipulate the data, save it as a csv file and import it back into my DB. My problem is that when I save it as csv, Excel is not giving me the correct number of commas for the number of fields I need. It appears to give me the commas until it decides that that column has been empty too long. I have tried resaving my excel files in v2000 and that doesn't help. I need to use the last column even though it is generally empty (it creates a necessary field in my DB). Am I doing something wrong? Any great ideas??? <img src=/S/question.gif border=0 alt=question width=15 height=15>

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Saving as csv (2000)

    I have use a couple of workarounds for this in the past. One is to move the columns around so that the last column always contains data. A second one is to add a dummy column on the right that apways contains data and then delete the field after it is imported into the DB. A third alternative is to define the DB field with a default value.

    If those don't work for you for some reason, you could always write a VBA procedure to output the data.
    Legare Coleman

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Saving as csv (2000)

    If your data doesn't contain too many different fields, you might try this trick: Concatenate all your fields into one field, inserting the commas yourself. One of the data transformations I work begins with columns of numbers on the initial worksheet, converts all the numbers to text on a second worksheet, and then =a1&","&b1&","&c1... formulas to create one long field on a third worksheet. I then export the third page as a Formatted Text (Space Delimited), which saves the page as a .PRN file. You could use this directly as your input file, or rename it as a .CSV file if your DB requires it.

    This might entail a little extra work the first time, but after that it doesn't really add any significant amount of time to the process. It also allows you to have complete control over the output instead of having to trust Excel to give you what you need.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •