Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening a CSV File-Format Changes (XP)

    When I open a CSV file with Excel some of the formatting is lost. As an example I have a column in the CSV file named BUnits in which one of the BUnits is "00001". Upon opening the CSV file with Excel the BUnit column reflects "1" not "00001".

    Any suggestions.

    Thanks,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Opening a CSV File-Format Changes (XP)

    A CSV file is a plain text file, it doesn't really contain number formats. When you open it in Excel, numbers will be formatted as General, so 5 and 05 and 5.0 will all become 5. You can apply number formatting in Excel, but you'll have to save the file as an Excel workbook (.xls), if you save as a .csv file, the formatting will be lost again.

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Opening a CSV File-Format Changes (XP)

    If you want "0001" as text instead of the number 1 formatted with leading zeroes, you could change the extension from CSV to TXT then you could open it and let the import wizard do its thing. You could set to comma-delimited and explicitly tell XL to import that column as Text and thus the formatting will remain.

    Steve

  4. #4
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening a CSV File-Format Changes (XP)

    Renaming the CSV file to a text file work.

    Hans/Steve-Thank you for your suggestions.

    Regards,
    John

Posting Permissions

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