Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wildcard pattern matching and replace in string

Well, having spent pretty much all day on this "little"
project that sounded so easy originally, I finally found
RegExp & its wonderful pattern-matching capabilities. And
I finally found enough help on the topic to put something
together that works, even if I'm not completely sure how.


-----Original Message-----
Ok, here's a "fun" one...
Running Excel 97.

I have 2 files. The first file is a 12,000 line

partsbook
that has a bunch of old numbers in it that need to be
replaced. The second file is a list of over 7,000 old
numbers and the new ones that replace them.

The partsbook is actually a text file, but I've also
imported it into Excel, so I could use either format for
this. The first problem is that each line is 558
characters long. The second problem is that there's
really no good way to split it into columns, since there
are multiple line types and each type has a different
arrangement.

My first thought was to loop through the replacement

list,
searching each line of the partsbook for each number in
the list. It would work fabulously if I had a couple
extra years and a spare computer....

The old part numbers are in the format #.###.####.# or
##############
What I'd like to do is search each line of the partsbook
for anything that matches those patterns, then do a

simple
lookup to find the replacement number and replace the old
number with the new number. But I can't figure out how

to
do a pattern matching search AND capture the resulting
string AND replace it.

Any ideas?
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keep text matching a wildcard spec in replace/substitute Hershmab Excel Worksheet Functions 3 September 12th 09 08:28 PM
Pattern Matching [email protected] Excel Discussion (Misc queries) 6 September 24th 07 09:19 PM
Replace pattern of characters Fernando Excel Discussion (Misc queries) 5 March 21st 07 09:33 PM
pattern matching possible? vito Excel Worksheet Functions 1 May 16th 06 05:03 PM
Wildcard string Robo Excel Discussion (Misc queries) 2 November 22nd 05 03:26 PM


All times are GMT +1. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"