Results 1 to 8 of 8
  1. #1
    dkelch
    Guest

    Commas in Excel .csv files (Excel 97 SR-2)

    Saving a two-column workseet in comma-separated-variable format results in inconsistent use of commas. The first column contains n consecutive, non-empty cells. The cells of the second column may, or may not, be empty. In the output .csv file, some of the rows contain a comma after the first-column value, and some don't. Excel seems to process the records in 16-row blocks. See attached file (open it in Word after unZIPping it...). Is there a way to force Excel to place commas in ALL records of .csv files???

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Commas in Excel .csv files (Excel 97 SR-2)

    Worked fine for me. Are you sure those cells aren't merged? I've got Excel 2000.

  3. #3
    dkelch
    Guest

    Re: Commas in Excel .csv files (Excel 97 SR-2)

    The cells are NOT merged. Looks like it is a "feature" of Excel 97...

  4. #4
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Commas in Excel .csv files (Excel 97 SR-2)

    Well, since you need to check it in Word anyway, have you tried selecting your cells, copy, then paste into Word? It should paste as a table. Click in one of the table cells, hit Table-Select table. Hit Table-Convert table to text, enter the appropriate number of columns and use a comma to separate the cells. Save as a text file and change the name to CSV. You could do this with macros I think.

  5. #5
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Commas in Excel .csv files (Excel 97 SR-2)

    Dkelch

    Worked fine for me. Are you sure those cells aren't merged? I've got Excel 97 SR-2 (i)

    I got two columns, A has 1,2,3,4,5... and B has 9991,9992,9993 and then in cells B7 - B22 there is "nothing", and all else seems to be normal.

    Look at other not so obvious reasons why this is going on.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  6. #6
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Commas in Excel .csv files (Excel 97 SR-2)

    Just a guess: what are your regional settings? What is the list separator and what is the decimal separator? Could it be that your problem has to do with this?

  7. #7
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Commas in Excel .csv files (Excel 97 SR-2)

    This is a "feature" of XL97 and XL2K. Excel will not consistently use the same number of commas on each line. The only work-around that I can find is to globally replace all of the empty cells in the used range with a single quote:<pre><Ctrl> <Home>
    <Ctrl> *
    Edit > Replace
    Find What: leave empty
    Replace with: '</pre>

    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  8. #8
    dkelch
    Guest

    Re: Commas in Excel .csv files (Excel 97 SR-2)

    Thanks SammyB! Works like a champ!

Posting Permissions

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