!DATASOURCE

From iMacros
Jump to: navigation, search

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 iMacros Browser IE Plug-in Firefox Chrome

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

  1. iMacros Browser 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.
  2. Firefox iMacros for Firefox uses the a comma as the default delimiter. To specify a different separator, use !DATASOURCE_DELIMITER.
  3. Chrome 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