import full .txt with SET !DATASOURCE not only certain line

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
Mr Designer
Posts: 5
Joined: Thu Jun 25, 2015 2:03 pm

import full .txt with SET !DATASOURCE not only certain line

Post by Mr Designer » Wed Sep 01, 2021 3:47 pm

I am trying to use the command

Code: Select all

SET !DATASOURCE
to import the whole text from ".txt" file into some textbox but I cannot find the exact command that would let me import/copy the whole textfile into the box text,

so far I have found {{!COL1}}

in ( SET !DATASOURCE ) instruction page but It only imports the first line from the .txt file and not full text

is there any way that I could import/copy whole text file? and not only some certain lines!
code example:

Code: Select all

SET !DATASOURCE TOPIC.txt
SET !DATASOURCE C:\TOPIC.txt
TAB T=1
TAB CLOSEALLOTHERS
'SET !PLAYBACKDELAY 0.00
URL GOTO=https://www.********.com
FRAME F=1
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY" CHARS="{{!COL1}}"
FRAME F=0

Code: Select all

info: imacros software 2021.0 May version - windows 10 64 - Trial mode
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: import full .txt with SET !DATASOURCE not only certain line

Post by chivracq » Thu Sep 02, 2021 2:51 am

Mr Designer wrote:
Wed Sep 01, 2021 3:47 pm
I am trying to use the command

Code: Select all

SET !DATASOURCE
to import the whole text from ".txt" file into some textbox but I cannot find the exact command that would let me import/copy the whole textfile into the box text,

so far I have found {{!COL1}}

in ( SET !DATASOURCE ) instruction page but It only imports the first line from the .txt file and not full text

is there any way that I could import/copy whole text file? and not only some certain lines!
code example:

Code: Select all

SET !DATASOURCE TOPIC.txt
SET !DATASOURCE C:\TOPIC.txt
TAB T=1
TAB CLOSEALLOTHERS
'SET !PLAYBACKDELAY 0.00
URL GOTO=https://www.********.com
FRAME F=1
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY" CHARS="{{!COL1}}"
FRAME F=0

Code: Select all

info: imacros software 2021.0 May version - windows 10 64 - Trial mode

Yep..., '.TXT' Extension is perfect, (doesn't work with '.CSV' Extension), open your File in a TAB_2, (with 'URL GOTO' + 'file' Protocol), and extract it (=> 'EXTRACT=TXT') on 'TYPE=PRE', that will extract the whole Content of the File... :idea:
('BODY' or 'HTML' for the 'TYPE' Param work also, but 'PRE' is the "cleanest"...)

Drag your File from 'Windows Explorer' once to some open Tab in iMB (or any Browser), or open it through 'File > Open File' to get the full URL to reuse for 'URL GOTO'... :idea:

That works with iMacros for FF v8.x (v8.8.2 + v8.9.7), I would think it (probably?) also works for iMB v2021.x, if it supports the 'file' Protocol, which I would expect is the case... (I cannot try/test, I installed some 'Trial' Version a few months ago, is already long finished... )

... And just to be "clear", 'URL GOTO' + 'EXTRACT' do "the Job", you don't need '!DATASOURCE' + '!COLn'... 8)

>>>

+ Parallel Thread on SOF:
- import full .txt with SET !DATASOURCE not only certain line on imacros
Same Content, except FCI a bit "mutilated", and I posted the same Solution... :P
- (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...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: import full .txt with SET !DATASOURCE not only certain line

Post by chivracq » Tue Sep 07, 2021 2:41 am

Hum, "impressive" Follow-up, nearly one week later, both on our Forum and on SOF where I had also posted an "Answer" to your parallel Thread...! (Yep, meant sarcastically...!) :roll:

I actually had some "extra Info" and another Solution..., that I obviously didn't (and probably won't) post because of the "poor" Follow-up... :idea: :roll:

(+ I noticed that you had created a New Thread and deleted it "silently" instead of sharing the Solution (“Imacros does not make interaction with rich textbox”), which is "usually"/often a "Show-Stopper" for me to (try to) help Users any further... :| )
- (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