Losing zeros opening a CSV file

Posted on 2012-09-07
Last Modified: 2012-09-07
Hi, i have a text file where the leading zero is being dropped when i open using excel.

Is there anyway to preserve the zero?

Question by:Seamus2626
    LVL 20

    Expert Comment

    You can preserve it by forcing it to be treated as alpha rather than numeric...

    Do this by editing the text file with a quote (") prior to the field...

    I presume this is probably a zip-code? Not that it matters!

    Author Comment

    No, its just data in a notepad. But when it opens as a CSV it loses the leading zeros.

    How can i introduce the (") to the field, where is this enetered?

    LVL 20

    Accepted Solution

    See the following article on how to preserve leading zeros...

    You can ignore my prior answer as it doesn't work!

    Author Closing Comment


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now