Extracting Data From Local Text File

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Extracting Data From Local Text File

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

Re: Extracting Data From Local Text File

by chivracq on Thu May 25, 2017 2: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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extracting Data From Local Text File

by cam on Thu May 25, 2017 8:31 am

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 4:47 pm

Re: Extracting Data From Local Text File

by cam on Thu May 25, 2017 3: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 9:15 am, edited 1 time in total.
cam
 
Posts: 6
Joined: Wed May 24, 2017 4:47 pm

Re: Extracting Data From Local Text File

by chivracq on Fri May 26, 2017 7:08 am

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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6490
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: No registered users and 5 guests

-->