rusty.hammond at cpiqpc.com
rusty.hammond at cpiqpc.com
Mon Apr 14 13:11:23 CDT 2003
Was just thinking about that after I sent the e-mail. Sometimes it pays to go back over a project and re-think it. -----Original Message----- From: Mike and Doris Manning [mailto:mikedorism at ntelos.net] Sent: Monday, April 14, 2003 11:55 AM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Search for string with wildcard characters What about searching for "N1~GA~" and having the program replace the 8 characters that follow with the new date? You could probably add an additional fields to your search/replace table to denote places where the search string is followed by a date that needs to be replaced instead of the actual string being replaced. 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 12:00 PM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Search for string with wildcard characters 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 _______________________________________________ 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