+ Reply to Thread
Results 1 to 6 of 6

Importing CSV turns characters to exponent

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Importing CSV turns characters to exponent

    Excel 2003 & 2007

    Here are the contents of the text file being imported:
    "Account Name","Account Type","Account Number"
    "test 1","test 1","0123456789abcdefghij0123456789abcdefghij"
    "test2","test2","0123456789012345678901234567890123456789"
    Excel does this:
    Account Name Account Type Account Number
    test1 test 0123456789abcdefghij0123456789abcdefghij
    test2 test2 1.23457E+38
    Turn the 1.23457E+38 into a number and...
    0123456789012345678901234567890123456789
    becomes
    123456789012345000000000000000000000000

    Turn the 1.23457E+38 into and it remains 1.23457E+38



    What do I have to do to get Excel to simply accept the literal value from a CSV?

    pls & tks

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Importing CSV turns characters to exponent

    change the .csv file extension to .txt (right click, rename)
    then use excel to open it
    when the wizard opens
    check delimited
    click next
    leave "tab" checked and check "other" put a ", " in the box
    click next
    click the field with your number in it and then check text under "column data format" the field name will change to text
    click finish
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    06-09-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Importing CSV turns characters to exponent

    So there's no setting in Excel to simply accept literals as literals? One has to go through the import text to columns hassle?

    My problem is I need Excel to read the file without converting the data automatically. Manually going through the wizard isn't a reasonable process every time this type of data is needed.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Importing CSV turns characters to exponent

    excel only handles 15 digits! as number

  5. #5
    Registered User
    Join Date
    06-09-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Importing CSV turns characters to exponent

    Thanks!

    How would I build my csv to note that it's not a number? It's text.

    Changing the field type to text just gets me the exponent in text, not the literal text from the csv.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Importing CSV turns characters to exponent

    Record a macro.
    Entia non sunt multiplicanda sine necessitate

+ 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