Extract A Certain Part of Text (Partial)

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Reaper
Posts: 15
Joined: Fri Jun 03, 2016 10:26 am

Extract A Certain Part of Text (Partial)

Post by Reaper » Wed Jul 13, 2016 6:53 am

iMacros for Firefox 8.9.7 (Firefox 47) , Win 7 x64
Extraction Dialog is created by Imacros 10 IE

The Actual Text is

Code: Select all

Dear xxxxxxx
Please log in using your login code below:
qpy6HW

This email was sent because someone tried to log in from a new browser or location with your correct email address and password.
If it wasn't you trying to log in, please change your password immediately. Please also consider changing your password on all services you are using this password for.
I want to extract the

Code: Select all

qpy6HW
This Code always changes but the location of the code is always the same

i am trying to store this Code Portion in !VAR
and later use it

in my example the code is

Code: Select all

qpy6HW
and i want to store this in !VAR

Is it Possible ?

I can Extract the entire Text
Its from an Email

I can help you get an idea if you need a live example . just tell me i will arrange something .
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract A Certain Part of Text (Partial)

Post by chivracq » Wed Jul 13, 2016 9:22 am

Reaper wrote:

Code: Select all

iMacros for Firefox 8.9.7 (Firefox 47)  , Win 7 x64
Extraction Dialog is created by Imacros 10 IE

The Actual Text is

Code: Select all

Dear xxxxxxx
Please log in using your login code below:
qpy6HW

This email was sent because someone tried to log in from a new browser or location with your correct email address and password.
If it wasn't you trying to log in, please change your password immediately. Please also consider changing your password on all services you are using this password for.
I want to extract the

Code: Select all

qpy6HW
This Code always changes but the location of the code is always the same

i am trying to store this Code Portion in !VAR
and later use it

in my example the code is

Code: Select all

qpy6HW
and i want to store this in !VAR

Is it Possible ?

I can Extract the entire Text
Its from an Email

I can help you get an idea if you need a live example . just tell me i will arrange something .
Yep, easily achievable with 'EVAL()' and 'split()' (x2), search my Posts, I've already produced several Examples...

(It can be done with 'replace()' as well instead of 'split()', though less reliable and a bit more cumbersome, or with 'indexOf()' + subStr()'/'subString()' (several Examples on the Forum as well), but 'split()' is the best way imho...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply