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
...
-
14th February 2007, 12:07 PM #1 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
-
-
IDG Tech News
-
14th February 2007, 12:16 PM #2
- Rep Power
- 15
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.
-
-
14th February 2007, 01:06 PM #3
- Rep Power
- 0
Re: need to extract text from a string in excel

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)
-
-
14th February 2007, 01:18 PM #4 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
-
-
14th February 2007, 01:22 PM #5
- Rep Power
- 15
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")
-
-
14th February 2007, 01:25 PM #6 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
-
-
14th February 2007, 01:37 PM #7
- Rep Power
- 15
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")
-
-
14th February 2007, 02:41 PM #8 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:
Similar Threads
-
By projector1 in forum MIS Systems
Replies: 2
Last Post: 10th December 2007, 11:30 AM
-
By FN-GM in forum Windows
Replies: 6
Last Post: 1st August 2007, 01:15 PM
-
Replies: 5
Last Post: 4th June 2007, 09:10 PM
-
By ChrisH in forum Windows
Replies: 6
Last Post: 22nd March 2006, 08:26 PM
-
By NetworkGeezer in forum Networks
Replies: 2
Last Post: 16th March 2006, 08: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
-
Forum Rules