Returns a list with the last line of a file. The number of lines should be indicated in the attribute lines.
1 file.tail
<file.tail lines='lines'>
<file /> !
</file.tail>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Alines | number | Number of lines which you have to obtain from the end of the file includinf the last line. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Efile | file |
Returns | |
---|---|
Type | Description |
Array | An array with the last n lines of the file. |
Example
Get the last 10 lines of a file.
Copy
<xsql-script name='file_tail_sample1'> <body> <set name='arr'> <file.tail lines='10'> <file name='#m_srcfile' type='absolute' /> </file.tail> </set> <println> <arr/> </println> <iterator name='line' index='idx'> <in> <arr/> </in> <do> <println><idx/>: <line /></println> </do> </iterator> </body> </xsql-script>