Jump to content
Macro Express Forums

Wildcards in Modify String Variable


nmanager

Recommended Posts

Can a wildcard be used in Modify String Variable/Replace Substring? If so how? Looking to remove the year from a string -

12/2008 to just 12. Tried to remove /* and /? but they do not work. Can't just move over 2 characters because there is no leadng 0 on single digit months - 1/2008.

 

Can replace / with a few blanks, then delete part of text, then trim, but looking for something a little "cleaner"

Thanks

Link to comment
Share on other sites

No, unfortunately there isn't any provision for the use of wild cards in the Modify String Variable command.

 

Here's how you can do what you want with two lines. This will work if you always have a 4 digit year.

 

Variable Set Integer %N1% from Position of Text in Variable %T1% - set the Search Text to the / character

Variable Modify String: Delete Part of %T1% - start the delete from position N1 and delete 5 characters

Link to comment
Share on other sites

Or you can copy part of string from T1 beginning at one for two characters back onto T1 then replace all instances of the slash with nothing. That gets it down to two lines at least

<TMVAR2:10:01:01:001:002:><TMVAR2:21:01:00:000:000:/>

Link to comment
Share on other sites

I use something like I think you want to do, seperating names and in other instances take out slash / marks out of dates. I'm sure you could alter this code to find the first slash and then delete everything from it on, leaving the month, regardless if it's one or two digits. Where I have this code find the first space you can have it find the first slash. Good Luck.

 

<REM2:Copies Full Name><TVAR2:09:03:><MSD:75><TMVAR2:01:09:00:000:000:><REM2:Copies Full Name to T4><TMVAR2:09:12:09:000:000:><MSD:75><REM2:Finds position of the first space in T4><IVAR2:01:13:12: ><MSD:75><REM2:Copies First Name to T10 using N1 (1st position to space)><TMVAR2:10:10:12:001:N01:><MSD:75><REM2:Deletes the First Name from T4><TMVAR2:11:12:00:001:N01:><MSD:75><REM2:Finds position of the first space in T4 after First Name has been deleted.><IVAR2:01:13:12: ><MSD:75><REM2:Copies Middle Name to T11 using N1 (1st position to space)><TMVAR2:10:11:12:001:N01:><MSD:75><REM2:Deletes theMiddle Name from T4><REM2:Leaving the Last Name in T12><TMVAR2:11:12:00:001:N01:><MSD:75><TMVAR2:01:10:00:000:000:><MSD:75><TMVAR2:01:11:00:000:000:><MSD:75><TMVAR2:01:12:00:000:000:><MSD:75>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...