[AccessD] Search for string with wildcard characters

rusty.hammond at cpiqpc.com rusty.hammond at cpiqpc.com
Mon Apr 14 11:00:19 CDT 2003


I think if there was a way to incorporate the Like operator with the InStr
function then my problem would be solved.  

Let me explain what I'm doing and maybe someone will have suggestion for a
better way of doing it.

My client sends a text file of invoices to a Railroad (RR) company.  This RR
requires a specific file format for their billing system to import the
invoices.  My client has tried working with their accounting software people
to get the format they need but they say they have done what they need to do
so if it requires more coding they will do at a fee of $250 per hour and
quoted 25 hours (great money if you can get it).  

Anyway, I'm taking the text file the accounting software creates which is
close to what is needed, and making the few more changes to it to make it
compatible with the RR company.  So far, I've discoved that by searching the
file for certain strings, I can replace that string with something else.
It's been fairly simple up to this point since the strings I'm searching for
have all been static.  I'm storing the strings to search for and replace
with in a table so if something changes they just adjust the strings in the
table and away we go.

Now we have a change where the portion of the file I need to change includes
a date which changes with each new file.  Now, I could have the client
change the date in the searchfor string each time they run the program for a
new file but it would be really nice if I could have a function search for
"N1~GA~????????" (where the ?'s represent a date in yyyymmdd format)in this
string "REF~03~!N1~GA~20020414" and return a 9.

Clear as mud?

Rusty

-----Original Message-----
From: Mike and Doris Manning [mailto:mikedorism at ntelos.net]
Sent: Monday, April 14, 2003 10:20 AM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Search for string with wildcard characters


How about InStr function?

Doris Manning
Database Administrator
Hargrove Inc.
www.hargroveinc.com


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
rusty.hammond at cpiqpc.com
Sent: Monday, April 14, 2003 10:57 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Search for string with wildcard characters


Does anyone have any code that will search a string variable for a string
that includes wildcard characters and returns the location?

ie
strVariable="This is a test"
search strVariable for "te??" returns 11


Rusty

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list