The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "!DATASOURCE"
(→Examples: added links to demo macros) |
|||
(13 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | Specifies the name and location of an input file for merging data with macro. If no folder is supplied the file is assumed to lie in the standard data input directory of your iMacros installation, e.g. | + | Specifies the name and location of an input file for merging data with macro. If no folder is supplied the file is assumed to lie in the standard data input directory of your iMacros installation, e.g. %USERPROFILE%\Documents\iMacros\Datasources\. |
− | === Value [[Image:IMacros-icon.png|iMacros Browser]] [[Image:Ie-icon.png|IE Plug-in]] [[Image:Ff-icon.png|Firefox]]=== | + | Currently iMacros can read data sources files only in [[csv|CSV]] format. |
+ | |||
+ | === Value [[Image:IMacros-icon.png|iMacros Browser]] [[Image:Ie-icon.png|IE Plug-in]] [[Image:Ff-icon.png|Firefox]] [[Image:Cr-icon.png|Chrome]]=== | ||
Line 17: | Line 19: | ||
SET !DATASOURCE C:\mysource.txt | SET !DATASOURCE C:\mysource.txt | ||
− | + | If the path contains spaces, you can surround the entire value with double-quotes, but you must also escape the backslash characters with another backslash: | |
+ | |||
+ | SET !DATASOURCE "C:\\My iMacros DataSources\\mysource.txt" | ||
+ | |||
+ | Alternatively, you can replace the spaces with a <SP> tag and omit the enclosing double-quotes and escaped backslashes: | ||
+ | |||
+ | SET !DATASOURCE C:\My<SP>iMacros<SP>DataSources\mysource.txt | ||
+ | |||
+ | Sample macros: [[Demo-Datasource]], [[Demo-Loop-Csv-2-Web]] | ||
+ | |||
+ | === Notes === | ||
+ | |||
+ | # [[Image:IMacros-icon.png|iMacros Browser]] [[Image:Ie-icon.png|IE Plug-in]] iMacros for IE and the iMacros browser can use either a comma as a CSV separator, or the list separator as set in the Windows Regional Settings. To set the separator for both reading and writing (as in [[SAVEAS]] TYPE=EXTRACT) CSV files, use the check box in the iMacros Options dialog. | ||
+ | # [[Image:Ff-icon.png|Firefox]] iMacros for Firefox uses the a comma as the default delimiter. To specify a different separator, use [[!DATASOURCE_DELIMITER]]. | ||
+ | # [[Image:Cr-icon.png|Chrome]] As of May 2014, you also need to install the [[iMacros_for_Chrome#Add_File_Access|File Access Module]] for Chrome in order to access data files. | ||
=== See Also === | === See Also === | ||
+ | |||
+ | [[!DATASOURCE_DELIMITER]], Do not confuse with [[!FOLDER_DATASOURCE]] | ||
+ | |||
+ | [[!DATASOURCE_LINE]] for selecting a specific record |
Revision as of 13:15, 11 March 2015
Specifies the name and location of an input file for merging data with macro. If no folder is supplied the file is assumed to lie in the standard data input directory of your iMacros installation, e.g. %USERPROFILE%\Documents\iMacros\Datasources\.
Currently iMacros can read data sources files only in CSV format.
Value
Valid name and location of the input file.
Set By
[ ] Internal
[X] SET
Internal means that the iMacros program itself sets the value of the variable during program run. SET means that the user can set this value via the SET command inside a macro.
Examples
SET !DATASOURCE C:\mysource.txt
If the path contains spaces, you can surround the entire value with double-quotes, but you must also escape the backslash characters with another backslash:
SET !DATASOURCE "C:\\My iMacros DataSources\\mysource.txt"
Alternatively, you can replace the spaces with a <SP> tag and omit the enclosing double-quotes and escaped backslashes:
SET !DATASOURCE C:\My<SP>iMacros<SP>DataSources\mysource.txt
Sample macros: Demo-Datasource, Demo-Loop-Csv-2-Web
Notes
- iMacros for IE and the iMacros browser can use either a comma as a CSV separator, or the list separator as set in the Windows Regional Settings. To set the separator for both reading and writing (as in SAVEAS TYPE=EXTRACT) CSV files, use the check box in the iMacros Options dialog.
- iMacros for Firefox uses the a comma as the default delimiter. To specify a different separator, use !DATASOURCE_DELIMITER.
- As of May 2014, you also need to install the File Access Module for Chrome in order to access data files.
See Also
!DATASOURCE_DELIMITER, Do not confuse with !FOLDER_DATASOURCE
!DATASOURCE_LINE for selecting a specific record