+ Reply to Thread
Results 1 to 8 of 8

1001001004006_001.tif to 001.001.001.004.006_001.tif

  1. #1
    Registered User
    Join Date
    03-07-2005
    Location
    Brussels
    Posts
    21

    Question 1001001004006_001.tif to 001.001.001.004.006_001.tif

    Hi,

    Anybody can help me out converting a list of these:
    1001004003001_001.tif
    1002006008002001_001.tif

    to:
    001.001.004.003.001_001.tif
    001.002.006.008.002.001_001.tif

    Thanks in advance

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Or try

    =SUBSTITUTE("00"&SUBSTITUTE(A1,"00",".00"),"_.00","_00")

    Assumes data in A1

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    My proposal is slightly different from VBA Noob's ...

    Please Login or Register  to view this content.
    HTH
    Carim

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Carim,

    Your's returns _.001

    That's why I used the sec Subtitute

    VBA Noob

  5. #5
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    VBA Noob,

    Well with my old version of XL,
    your formula returns 1.tif in the second case
    whereas my formula returns correct answers in both instances ...
    strange ... no ?

    Cheers
    Carim

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Very

    Oh well. He should get one of them to work

    Your return for me

    001.001.004.003.001_.001.tif

    My Double returns

    001.001.004.003.001_001.tif



    VBA Noob

  7. #7
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    VBA Noob,

    Sorry tested your formula too quickly it does work fine ...
    Would you accept ALL my apologies ...
    I had not noticed the additional point .. I am getting old ...

    Cheers
    Carim
    Last edited by Carim; 11-26-2006 at 12:29 PM.

  8. #8
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Dbase Beginner
    Hi,

    Anybody can help me out converting a list of these:
    1001004003001_001.tif
    1002006008002001_001.tif

    to:
    001.001.004.003.001_001.tif
    001.002.006.008.002.001_001.tif

    Thanks in advance
    Hi,

    The examples shown are 3 digit numbers with single digit values, in which case the formula will work to adjust.

    However, once the double zero '00' is lost the formula may not work as expected, and the only solution short of VB code I could see is as per the attached, where: data in column A

    In column F (untidy column selection)

    =IF(MOD(FIND("_",A1)-1,3)=1,"00",IF(MOD(FIND("_",A1)-1,3)=2,"0",""))

    in column G

    =F1&LEFT(A1,FIND("_",A1)-1)

    in column H

    =MID(A1,FIND("_",A1),999)

    in column I

    =LEFT(G1,3)&IF(LEN(G1)>3,"."&MID(G1,3,3)&IF(LEN(G1)>6,"."&MID(G1,4,3)&IF(G1>9,"."&MID(G1,10,3)&IF(G1>12,"."&MID(G1,13,3)&IF(LEN(G1)>15,"."&MID(G1,16,3),""),""),""),""),"")&H1

    your solution.

    To explain, column F determines the first 'set' as 1, 2 or 3 digits ie, 1, 11 or 111

    Column G adds F to the required portion of A

    Column H has the trail

    Column I puts a period (.) between each set of 3 and adds the trail.

    Hope this helps
    ---
    Attached Files Attached Files
    Last edited by Bryan Hessey; 11-26-2006 at 05:14 PM.
    Si fractum non sit, noli id reficere.

+ 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