Link to home
Start Free TrialLog in
Avatar of sunhux
sunhux

asked on

Excel/Word 2003 macros to replace variable text strings with null/space

www.aa.com.crt_12345_1.txt
www.bb.com.crt_678_2.txt
www.cc.com.crt_99_3.txt
.....

I would like to put all the above hundreds of lines in Word/Excel &
remove everything from .crt_XXX_Y.

So the resulting output should be:
www.aa.com.txt
www.bb.com.txt
www.cc.com.txt

I'm not too good with Excel/Word, so pls give a very layman's step by step instructions.
I've read about creation subFunction etc but don't even know how to invoke them
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

We cannot open the links. You need to post them as attached files not as a link.
gowflow
Avatar of sunhux
sunhux

ASKER

In the days I was administering OpenVMS, there's a TPU editor which I
could define macros to search for the string ".com.", start the "select",
then search for the ".txt" string, then invoke the "cut" function & record
these repeated keys in a macro by say pressing F12 to represent the series
of keys being pressed.

Then I would create another TPU macro which will record say pressing ten
times of F12 & record it to another key, say F11 & just by pressing F11,
I could do ten replacements such strings
Leave the programing for us will arrange that simply post the files properly as stated above.
gowlfow
Avatar of sunhux

ASKER

Those are not links that I've posted but only strings of plain text.

I'll also need to amend the text below to :
www.aa.com.crt_12345_1
www.bb.com.crt_678_2
www.cc.com.crt_99_3
. . .

www.aa.com.crt_12345_1
www.bb.com.crt_678_2
www.cc.com.crt_99_33

So will another macro that searches for ".crt", start "Select", then press the "End"
key to go end of the line, then press "Cut" or "Del" key
Avatar of sunhux

ASKER

Just treat those underlined links as plain text: somehow EE translates
them to links but I was just entering plain text
SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sunhux

ASKER

In Excel 2003, there's no "More>> button and tick the 'Use Wildcards' checkbox"
but there is "Options" button which does not show any 'Use WIldcards'.

What Saqib gave works.   Just curious, if we were to treat * as a character (not as
a wildcard) ie if we want to replace * with say null, how do we go about replacing?
Not that I have this need but curious
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sunhux

ASKER

One last question:
if I'm replacing <tab> character with a space character, how does this go?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In Word Find, the tab character is ^t
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial