+ Reply to Thread
Results 1 to 6 of 6

Excel is converting .csv files

Hybrid View

KRayKeeling Excel is converting .csv files 03-21-2008, 04:30 PM
KRayKeeling Excel is changing information... 03-21-2008, 04:50 PM
shg Threads merged. Please read... 03-21-2008, 05:57 PM
Richard Buttrey If the data has already been... 03-21-2008, 06:04 PM
mudraker Instead of opening thecsv... 03-21-2008, 06:43 PM
KRayKeeling Thank you everybody for... 03-21-2008, 07:00 PM
  1. #1
    Registered User
    Join Date
    07-12-2007
    Posts
    40

    Cool Excel is converting .csv files

    Hi!

    I am having a problem. We are using Visual Studio to create a program that takes a .txt file and converts it into a .csv file. When we load the .csv file into excel (on excel 2007) it is taking the information we put into Excel and changing it.

    It is deleting zeros out of the account numbers and changing certain numbers to dates. I need the stuff Excel is changing. But when I load the .csv file, Excel is designed to remove all the information that is not needed. This is done on default. Is there a way that I can change the default on excel, so it doesn't automatically change numbers or delete information?

    The account numbers will look like this: 078453 on the .csv file, but once converted to excel it looks like 78453.

    I can't change it to "keep as text" because the .csv file was already loaded and information was already removed.

    Can anybody help me with my situation? Please!

    Thank you,
    Kevin K.

  2. #2
    Registered User
    Join Date
    07-12-2007
    Posts
    40

    Excel is changing information from a .csv file

    Hi!

    I am having a problem. We are using Visual Studio to create a program that takes a .txt file and converts it into a .csv file. When we load the .csv file into excel (on excel 2007) it is taking the information we put into Excel and changing it.

    It is deleting zeros out of the account numbers and changing certain numbers to dates. I need the stuff Excel is changing. But when I load the .csv file, Excel is designed to remove all the information that is not needed. This is done on default. Is there a way that I can change the default on excel, so it doesn't automatically change numbers or delete information?

    The account numbers will look like this: 078453 on the .csv file, but once converted to excel it looks like 78453.

    I can't change it to "keep as text" because the .csv file was already loaded and information was already removed.

    Can anybody help me with my situation? Please!

    Thank you,
    Kevin K.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Threads merged. Please read the forum rules, and don't post the same thread in two forums.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by KRayKeeling
    Hi!

    I am having a problem. We are using Visual Studio to create a program that takes a .txt file and converts it into a .csv file. When we load the .csv file into excel (on excel 2007) it is taking the information we put into Excel and changing it.

    It is deleting zeros out of the account numbers and changing certain numbers to dates. I need the stuff Excel is changing. But when I load the .csv file, Excel is designed to remove all the information that is not needed. This is done on default. Is there a way that I can change the default on excel, so it doesn't automatically change numbers or delete information?

    The account numbers will look like this: 078453 on the .csv file, but once converted to excel it looks like 78453.

    I can't change it to "keep as text" because the .csv file was already loaded and information was already removed.

    Can anybody help me with my situation? Please!

    Thank you,
    Kevin K.
    If the data has already been changed, and the zeros removed, then there's nothing you can do unless you can imply where zeros should be and add them back in with some VBA.

    Why not go back to the original csv file before the zeros were stripped out, or re-create it from the original source.

    Rgds

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Instead of opening thecsv file you could try using
    Data >
    Import External Data >
    Import Data >
    set Files Of Type to Text (which includes csv files)
    Select your csv
    Select Delimited
    Next Button
    Tick Comma option
    Next Button
    Select columns as required and change the Column data format option to Text
    Finish Button
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  6. #6
    Registered User
    Join Date
    07-12-2007
    Posts
    40
    Thank you everybody for posting their responses to help me out!! The programmer and I found a way to get around it... we went back to Visual Studio and put a caret (^) in front of all the values in the column that must remain original. Then we went and converted it to Excel and replaced the ^ with an apostrophe (which in excel converts that cell to text). It kept the values the way we needed...

    But once again thanks for all of your prompt replies!! You guys are the best!

    Kevin K.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1