Drak Posted March 26, 2007 Report Share Posted March 26, 2007 Okay, okay.. Something else I need help with again Here is an *example* of the 'Clipboard' I want to pull numbers from: [asdghwektk34]24419001041}safffasvkkaksk532 dasd-as9cikl2k3mltm2l vlk,,fa h: (515) 555-1551 asr123 asjdia98i312 fasfc23 (251) 414-1516 12ddasc t4rh45yhwerfweaccasccaccasc 314r3r13 (251) 123-4567 Basically, I just want to get the three phone numbers out of there while setting each one to a Variable as fast as possible. Any help is appreciated and I hope this is possible? End result would be like... %t1%=(515) 555-1551 %t2%=(251) 414-1516 %t3%=(251) 123-4567 Thanks! Quote Link to comment Share on other sites More sharing options...
Cory Posted March 26, 2007 Report Share Posted March 26, 2007 Write the clipboard copy to a text variable T4 then parse out your phone numbers. Now if the number of characters is the same you can just grab the text from character number X to Y for all three. However it's more likely to be different each time. In this case I would get the position of the ( and stuff it in N1. Then decrement N1 by 1 and delete characters 1 thru N1. Now copy characters 1 – 14 to T1. Now delete the first character of T4. Now do the routine again for T2 and T3. Quote Link to comment Share on other sites More sharing options...
Drak Posted March 26, 2007 Author Report Share Posted March 26, 2007 I had made one that used ASCII or something like that but I couldn't completely get it to work and just deleted it after frustrations, perhaps you could shed some light with an example as I really am not too good with this? Perhaps Direct Editor format? If not, that's okay. I can read more about this kind of stuff heh. Quote Link to comment Share on other sites More sharing options...
Cory Posted March 27, 2007 Report Share Posted March 27, 2007 Here ya go: <CLIPC><TVAR2:01:03:><REM2:Find the position of the first (><IVAR2:01:13:1:(><REM2:Reduce the number 1 so we don't delete teh first (><NMVAR:09:01:0:0000001:0:0000000><REM2:Delete everythign up to the first (><TMVAR2:11:01:00:001:N01:><REM2:Grab the first phone number><TMVAR2:10:02:01:001:014:><REM2:Delete teh first character "(" so we don't get a 1 next time.><TMVAR2:11:01:00:001:001:><REM2:Do it again for the second number><IVAR2:01:13:1:(><NMVAR:09:01:0:0000001:0:0000000><TMVAR2:11:01:00:001:N01:><TMVAR2:10:03:01:001:014:><TMVAR2:11:01:00:001:001:><REM2:Do it again for the third number><IVAR2:01:13:1:(><NMVAR:09:01:0:0000001:0:0000000><TMVAR2:11:01:00:001:N01:><TMVAR2:10:04:01:001:014:><TBOX4:T:1:CenterCenter000278000200:000:T2= %T2% T3= %T3% T4= %T4% > If you find it mystifying how I got around the carriage returns you might want to check out my web page about using a hex editor as it covers the topic of how data appears as opposed to how the computer stores it. http://bluepointdesign.com/macros/hexedit.htm Quote Link to comment Share on other sites More sharing options...
Drak Posted March 27, 2007 Author Report Share Posted March 27, 2007 Thanks! It looks like I got it to work, but when there is less than 3 phone numbers it like relaps and takes the same number as before and chops it up so to say. I think I can fix this though EDIT: Yep, fixed it up nicely so it figures out how many there are first. Quote Link to comment Share on other sites More sharing options...
Cory Posted March 27, 2007 Report Share Posted March 27, 2007 Add a condition If N1<>0 (not equal to zero) for each of the extractions. If the ( is not found it N1 will eqaul zero and you know to skip it. You can also do some smarter logic as well to look for your phone numbers so you can get the Home in the right spot and such. For instacne you can look at the "h:" for the home number but in the example it is't clea what is consistent that can be used as a positional clue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.