by jking Wed Aug 02, 2017 8:22 pm
Yes, you can save a downloaded file (cvs, excel, pdf, xml, etc.). Every version of Kapow that I have used (since 9.2.5) has supported the write file step.
After you have exported the file into your variable add a Write File step. This step will either write a new file or it will append to an existing file.
Step Properties
File Name
The name of the file. The name must be an absolute file name, including the drive name, if any, and the directory path to the file. For example: C:\Folder\myspreadsheet.xlsx
File Content
The contents to write to the file. Normally I choose the variable I extracted the downloaded file into (Excel, pdf, etc.).
File Encoding
If the contents to write to the file is text, this property specifies the character encoding to use for encoding the text as bytes.
Append to File
Specifies whether a new file should always be created (overwriting any existing file with the same name), or whether the contents should be appended to the file if it already exists.
Create Directories
Specifies whether to create the necessary directories on the file path before creating a new file. If not selected, then the action will fail if any directory on the path does not exist.
Execute in Design Mode
If this is enabled, the action will be executed even in Design Mode inside Design Studio. If this is disabled, the action will do nothing when you navigate the robot in Design Mode.
A CSV can be written in two ways: Either write the file one line at a time with Write File, using an Add To CSV data converter to create each line. Alternatively, build up the desired file contents one line at a time in a global variable (again with the aid of the Add To CSV data converter) and use Write File in the end (that is, in an additional branch) to write the file in one piece.
In order to modify the global variable that holds the file contents, use an Assign Variable action that takes its input from a Get Variable data converter pointing to the variable itself. This is then followed by the Add To CSV data converter.