+ Post New Thread
Results 1 to 8 of 8
How do you do....it? Thread, need to extract text from a string in excel in Technical; i am trying to use the text function to copy a certain part of the string regsvr32.exe /s /c expsrv.dll ...
  1. #1
    projector1's Avatar
    Join Date
    Nov 2005
    Posts
    460
    Thank Post
    70
    Thanked 1 Time in 1 Post
    Rep Power
    18

    need to extract text from a string in excel

    i am trying to use the text function to copy a certain part of the string
    regsvr32.exe /s /c expsrv.dll
    regsvr32.exe /s /c INETWH32.dll
    regsvr32.exe /s /c MSJINT35.DLL
    i need to copy the text after the space that appears after "/c"
    the output i am looking for is

    expsrv.dll
    INETWH32.dll
    MSJINT35.DLL

    the only thing is i only know how to use the LEFT or RIGHT function from
    and i know there is a way where you can start from a particular point

    thanks

  2. #2

    Join Date
    May 2006
    Posts
    110
    Thank Post
    0
    Thanked 12 Times in 11 Posts
    Rep Power
    19

    Re: need to extract text from a string in excel

    =RIGHT(A1,LEN(A1)-SEARCH("/c",A1)-2)

    assuming that your text you want to extract FROM is in column A

    or

    =RIGHT(A1,LEN(A1)-19)

    assuming the text to the left of the file name is the same number of characters.

  3. #3

    Join Date
    Jan 2006
    Posts
    143
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: need to extract text from a string in excel

    Quote Originally Posted by projector1
    the only thing is i only know how to use the LEFT or RIGHT function from and i know there is a way where you can start from a particular point
    That'll be the MID function:

    MID(CellReference,start point in string,number of characters to return)

  4. #4
    projector1's Avatar
    Join Date
    Nov 2005
    Posts
    460
    Thank Post
    70
    Thanked 1 Time in 1 Post
    Rep Power
    18

    Re: need to extract text from a string in excel

    hats off to you!
    thanks

    my next question is i have a bat file that copies some ocx and dll files to the system32 folder. You have taught me how to extract text.
    What i need to do now is
    replace the "GPRY_CTL.ocx "

    echo No | copy /-Y L:\Software\GPRY_CTL.ocx C:\windows\systems32
    (this line has been repeated in several rows in the excel sheet)

    with these

    OLEPRO32.DLL
    RDOCURS.DLL
    roboex32.dll
    scrrun.dll
    STDOLE2.TLB
    sysinfo.ocx
    TABCTL32.OCX
    threed32.ocx
    Vb5db.dll
    VB6STKIT.DLL
    vbajet32.dll

    if you could show me how to do one i am sure i could carry out the rest

    thanks

  5. #5

    Join Date
    May 2006
    Posts
    110
    Thank Post
    0
    Thanked 12 Times in 11 Posts
    Rep Power
    19

    Re: need to extract text from a string in excel

    again, assuming your filenames are in column A:

    =CONCATENATE("echo No | copy /-Y L:\Software\",A1," C:\windows\systems32")

  6. #6
    projector1's Avatar
    Join Date
    Nov 2005
    Posts
    460
    Thank Post
    70
    Thanked 1 Time in 1 Post
    Rep Power
    18

    Re: need to extract text from a string in excel

    sorry i am gob smacked! very much appreciated!
    it has worked and i am on my way!
    thank you very much

  7. #7

    Join Date
    May 2006
    Posts
    110
    Thank Post
    0
    Thanked 12 Times in 11 Posts
    Rep Power
    19

    Re: need to extract text from a string in excel

    no problem

    and for completeness here it is using MID

    =MID(A1,20,12) or =MID(A1,20,LEN(A1)-19)

    and to do it all in one go

    =CONCATENATE("echo No | copy /-Y L:\Software\",MID(A1,20,12)," C:\windows\systems32")

  8. #8

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,762
    Thank Post
    3,271
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365

    Re: need to extract text from a string in excel

    Can't you use the split function and store it into an array and then to re call it you would just use the variable name and the index value , here is a vbscript example, but it will be pretty much the same in vba and vb 6 :

    dim txt,a
    txt="Hello World!"
    a=Split(txt," ")
    msgbox a(0) '<-- will have the word hello
    msgbox a(1) '<-- will have the word World!

    however for you txt will be

    regsvr32.exe /s /c expsrv.dll

    and each time you make txt equal to the command ie ( regsvr32.exe /s /c expsrv.dll )

    you will have to output the last value you want by making a(3)

    ie telling you want to output value of Index 3 which will be the 4th value.

    hence outputting the 4th value.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 2
    Last Post: 10th December 2007, 10:30 AM
  2. Extract the files from EXE Format
    By FN-GM in forum Windows
    Replies: 6
    Last Post: 1st August 2007, 01:15 PM
  3. Replies: 5
    Last Post: 4th June 2007, 09:10 PM
  4. Replies: 6
    Last Post: 22nd March 2006, 07:26 PM
  5. Text WEP key for hex input
    By NetworkGeezer in forum Wireless Networks
    Replies: 2
    Last Post: 16th March 2006, 07:16 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •