Extracting Data From Local Text File

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
cam
Posts: 6
Joined: Wed May 24, 2017 11:47 pm

Extracting Data From Local Text File

Post by cam » Wed May 24, 2017 11:56 pm

So what I want to do is make a text file (lets say notepad) and write something their (for example "May 24th 2017"). This text file will sit on my desktop.

I would like to create a macro that retrieves the string of text that I write in that file on my desktop and place it in a text box on a website.

The next day, I'll open that text file and edit the text (for example tomorrow I would edit it to say "May 25th 2017") and continue using the macro with the updated text.

Seems simply enough, is this possible? If not, are there any workarounds to accomplish the same thing? Thanks!
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extracting Data From Local Text File

Post by chivracq » Thu May 25, 2017 9:19 am

cam wrote:So what I want to do is make a text file (lets say notepad) and write something their (for example "May 24th 2017"). This text file will sit on my desktop.

I would like to create a macro that retrieves the string of text that I write in that file on my desktop and place it in a text box on a website.

The next day, I'll open that text file and edit the text (for example tomorrow I would edit it to say "May 25th 2017") and continue using the macro with the updated text.

Seems simply enough, is this possible? If not, are there any workarounds to accomplish the same thing? Thanks!
Yep, it's possible...
- (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...
cam
Posts: 6
Joined: Wed May 24, 2017 11:47 pm

Re: Extracting Data From Local Text File

Post by cam » Thu May 25, 2017 3:31 pm

chivracq wrote:Yep, it's possible...
That's great. Would you mind giving me some help? I apologize I'm very new to this. I'm using that latest version of iMacros with Google Chrome on windows 10.
cam
Posts: 6
Joined: Wed May 24, 2017 11:47 pm

Re: Extracting Data From Local Text File

Post by cam » Thu May 25, 2017 10:00 pm

UPDATE: I figured out everything on my own :mrgreen:
For any noobs like me out there this is the code I used:

To select a .txt file to extract from:

Code: Select all

SET !DATASOURCE C:\Your\Path\Will\Be\Different\TextFile.txt
To use data from that .txt file:

Code: Select all

{{!COL1}}
The above code will extract the data in the first column of your .txt file. Make sure the data in your .txt file is separated by commas like so: DATA1, DATA2, DATA3

Hopefully this helps someone.
Last edited by cam on Fri May 26, 2017 4:15 pm, edited 1 time in total.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extracting Data From Local Text File

Post by chivracq » Fri May 26, 2017 2:08 pm

cam wrote:
chivracq wrote:Yep, it's possible...
That's great. Would you mind giving me some help? I apologize I'm very new to this. I'm using that latest version of iMacros with Google Chrome on windows 10.
Yep, that's better, I normally don't react to Threads when FCI is not mentioned, read my Sig..., many Commands are not implemented for all Browsers/Versions...
Even if, hum..., "latest" doesn't mean much, especially to sbd reading the Thread in a few weeks/months/years... :roll:
=> Probable FCI: iMacros for CR v8.4.4, CR56/57, Win10.

Hum, and try selecting the correct Sub-Forum next time you open a Thread, the 'Data Extraction' Sub-Forum is reserved for Threads related to extracting Data from a Web-Page/Web-Site using the 'EXTRACT' Mechanism... This Thread might get moved to the 'General' Sub-Forum where it belongs...
cam wrote:UPDATE: I figured out everything on my own :mrgreen:
For any noobs like me out there this is the code I used:

To select a .txt file to extract from:

Code: Select all

SET !DATASOURCE C:\Your\Path\Will\Be\Different\TextFile.txt
To use data from that .txt file:

Code: Select all

{{!COL1}}
The above code will extract the data in the first column of you .txt file. Make sure the data in your .txt file is separated by commas like so: DATA1, DATA2, DATA3

Hopefully this helps someone.
Very-very good...! Seems like reading a little bit of Documentation and checking some Examples can bring some "Miracles", ah-ah...! And I guess it's more rewarding finding the Solution by yourself... 8)
Have a look at the Command Reference for a List of all Commands available in iMacros, that will save you a lot of Qt's you may have in the future and give you some ideas to what you can do in iMacros... :idea:
Thanks for sharing your Solution anyway, that's the perfect "Follow-up" for a Thread and to finish it "neatly" and to make it useful for other Users... :D
- (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