Skip to main content
Skip table of contents

Reading a File Line by Line

This page explains the Filesystem Adapter in Bridge context. If you were looking for the same information regarding the PAS Designer, refer to Filesystem Adapter in the Designer guide.

Parameters of Action "readLine"

NameTypeDirectionDescription
nameStringin

Fully qualified file name of the file you want to read, including the path.

When using the Windows style with backward slashes "\" you have to be aware that you have escape this character. The escape character is also the "\".
To avoid this, use forward slashes with Windows as well.

encodingStringinEncoding of the file. Default encoding is iso-8859-1.
For a list of possible encodings see Charset Definitions.
lineStringoutFile content of the line that has been read. On file end, line is NULL.
lengthIntegeroutLength (in Bytes) of the line that has been read. On file end, length is 0.

Defining a "readLine" Action

To read a file line by line with the file system adapter, you need to define a readLine action on an action having the stereotype <<FileSystemAdapter>>. You can do this manually (refer to Figure: The Specification Dialog of the File System Adapter) or with the help of the E2E Action Wizard (see context menu of the action node).

Figure: Reading a File Line by Line

The file content line is of the base type String and is stored in an output object named line. If line is not given back by the file system adapter (line=NULL), the end of file has been reached.

The path and file name of the file you want to access are defined in the component diagram. The link from the activity diagram to the physical information is established by an alias (in the present example: FileAlias). See File System Components for more information on file system aliases.
For information on how to access a file or directory dynamically refer to Dynamic File System Access.

Related Pages:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.