Returns an InputStreamReader from a file using the specified encoding.
1 file.cstream.reader
<file.cstream.reader encoding='encoding'>
<file /> !
</file.cstream.reader>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aencoding | string | Encoding of the file. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Efile | file |
Returns | |
---|---|
Type | Description |
InputStreamReader | InputStreamReader |
Example
Read a file with the encoding ISO-8859-1 and process it line by line.
Copy
<xsql-script name='file_cstream_reader'> <body> <set name='m_in'> <string.lineReader> <file.cstream.reader encoding='ISO-8859-1'> <file name='/tmp/file_iso.txt' type='absolute' /> </file.cstream.reader> </string.lineReader> </set> <while> <expr> <isnotnull> <set name='m_line'> <string.lineReader.readLine><m_in/></string.lineReader.readLine> </set> </isnotnull> </expr> <do> <println> <m_line /> </println> </do> </while> </body> </xsql-script>