+ Reply to Thread
Results 1 to 7 of 7

Keep leading zeros (Unknown locations)

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    Keep leading zeros (Unknown locations)

    How can I keep leading zeros without formatting a cell to text. I wont know where the cell(s) will be located.

    Example import text file: (not imported)
    Please Login or Register  to view this content.
    The first line would be seperated into cells such as: (The only known locations)
    A1. PARTSN_PARTSN_1:
    B1. SN
    C1. 090611

    I do not know where this line will fall inot next.
    PARTSN_PARTSN_1: SN 090611 .

    As it is it gets converted to "90611.0000" (Loss of leading zero)
    And I need it to be "090611".

    The number in Red allways changes, it is an assigned serial number. It can be numeric, alpha\numeric, numeric\alpha.
    One thing is certain, if it has a leading zero, it must retain the leading zero.

    Any hints, tips and or examples is appreciated.
    Last edited by Rick_Stanich; 08-11-2009 at 01:45 PM.
    Regards

    Rick
    Win10, Office 365

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

    Re: Keep leading zeros (Unknown locations)

    Why not format as text beforehand?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    Re: Keep leading zeros (Unknown locations)

    For the first instance of the serial number I had tried this, still lost the leading zero (perhaps I did somethign wrong); also I am unable to find each instance of the serial number (Row is unknown and there can be many). Cant search for what isnt there.
    Example: If I import 10 files to process, there could be upto 10 different serial numbers. Some files can have the same serial number as they may be part one of X.

    The example in my inital post is the first few lines (rows) from a .txt file.
    Attached Files Attached Files
    Last edited by Rick_Stanich; 08-11-2009 at 05:22 PM.

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

    Re: Keep leading zeros (Unknown locations)

    When you open the file from Excel, you specify space as the delimiter, true?

    In the same process, you can import all fileds as text. And automate it if you wish ...

  5. #5
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    Re: Keep leading zeros (Unknown locations)

    Yes to "space delimeter" and are you speaking of a text qualifier?

    This is the function I use (Thanks to this forum).
    Please Login or Register  to view this content.

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

    Re: Keep leading zeros (Unknown locations)

    Gotta bow out, Rick, I don't use query tables. I'm sure someone else here can help though.

  7. #7
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    Re: Keep leading zeros (Unknown locations)

    No worries, thanks for trying.

+ 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