File_Writer

Parent Previous Next

File IO / FileWriter
Block Name: FileWriter

Code File Location: VisualSim/actor/lib/io/ExpressionWriter

Block Overview

 o  Write any data to a file.   

 o  Capture data structure value or model statistics for use in other models or for further analysis.

 o  Do not use to save plot output, as the save function in the plotter blocks are better suited for the XML format.

Description

This block reads the input tokens and writes them, one line at a time, to a specified file. The format on the input is maintained in the file.

This block accepts a file name as a parameter. There are a number of file path options available for this block.  To see the list, view the section on File Paths in the Reference Guide document here. The file name is a concatenation of any number of individual strings and parameters, separated by "+".  To view the file path in a demo model, click here.

If the append attribute has value true, then the file will be appended to. 

If the confirmOverwrite parameter has value false, then this actor will overwrite the specified file if it exists without asking. If true (the default) and the file exists, this block will ask for confirmation before overwriting. Do not select this when using Batch mode.

Note

If the input Data Structure must be written on a single line for reading later on using the FileReader block, then make sure the data has been formatted using "recordTokenToLineWriter(input)" expression function before input to this block.

View the FileWriter Example in the BDE.


Parameter

Explanation

Type

File_Name

The format is either http://www.mirabilisdesign.com/filename.txt (URL, file located anywhere on the Internet) or C:/VisualSim/filename.txt (Windows) or file://VisualSim/filename.txt (Unix/Linux).  This is a concatenation of any number of individual strings and parameters, separated by "+".

String

append

When this is checkbox is selected, the current output is appended to the content currently existing in the file.

-

confirmOverwrite

When this checkbox is selected, a window will pop-up for the user to confirm whether to overwrite the current content of the file. This must not be selected when simulating in batch mode.

-



Port

Explanation

Type

Input

This is a default input port.

General




 

Created with the Personal Edition of HelpNDoc: Free EPub producer