+ Reply to Thread
Results 1 to 7 of 7

Replace leading zeros

  1. #1
    Registered User
    Join Date
    08-05-2008
    Location
    Edinburgh
    Posts
    15

    Replace leading zeros

    Hi,

    I am exporting company data to a IIF file and editing the data through Excel. The problem I'm having is when I export the data that contains credit card information it drops all the leading zeros from all the Expiry Dates, Start dates and CCV numbers.

    I have tried using the basic formula to convert to text ( =text(A1,"0000") ) which works in Excel but when I save the IIF file it doesn't store the new data as text and reverts it back to numerical data, dropping the leading zeros again.

    Is there a way to add the leading zeros in a numerical cell?

  2. #2
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: How do you replace leading zeros?

    If you can, open the IIF file (sorry I have no knowledge of what type of file this is) and see how the numbers are being stored there.

    To retain the leading zeros in Excel, the number must be stored as TEXT,
    make a new column and store the numbers with leading zeros as TEXT and use that column for exporting.
    You just can't use it in calculations.

    See this thread, that might help.
    http://www.excelforum.com/excel-gene...ml#post2371519

  3. #3
    Registered User
    Join Date
    08-05-2008
    Location
    Edinburgh
    Posts
    15

    Re: How do you replace leading zeros?

    Hi,

    Thanks for the reply but I don't think my problem can be solved. I have formatted several different ways but the problem is when I save the file as the .IIF it loses all formatting.

  4. #4
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: How do you replace leading zeros?

    when I save the file as the .IIF it loses all formatting.
    Reply With Quote


    Sorry, do not know what an .IIF file is or how it stores data.

  5. #5
    Registered User
    Join Date
    08-05-2008
    Location
    Edinburgh
    Posts
    15

    Re: How do you replace leading zeros?

    Its a file type used by QuickBooks. I think its only used when exporting data.

    Its the same message that pops up when you try to save an Excel file as a .csv. Something along the lines of "when you save as this file type you may lose format settings"...roughly

  6. #6
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Replace leading zeros

    After you export the data from QuickBooks, try opening the .IIF file with Notepad, see how the data is stored, and post an example.

    If it is a tab separated file or some combination of tabs and quote marks then when you import it to Excel, it will strip the zeros, as you have found out the hard way.

    Check in QuickBooks and see if there isn't some way to make the file more Excel compatible.

    If needed there is probably a way to create a filtering script that can add a tick to the beginning of all number fields in the .IIF file.

  7. #7
    Forum Contributor
    Join Date
    04-07-2009
    Location
    Rowley
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Replace leading zeros

    Found this page; see if it is of any help:

    http://support.quickbooks.intuit.com...rticle/1007545

    I believe the key may be using the Import Wizard and specifying the number fields as TEXT.

+ 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