Page tree
Skip to end of metadata
Go to start of metadata

The XLS protocol handler parses and writes Excel-compatible spreadsheets.

Remark: You need to install the XLS feature to use this protocol handler.

Options

  • worksheet: The name of the worksheet.
  • delay: Delay of reading in milliseconds (default 0). DEPRECATED: use scheduler.delay instead if not used together with delayeach
  • nanodelay: Delay of reading in nanoseconds (default 0).
  • delayeach: The number of lines between a delay is used (default 0).
  • readfirstline: Should the first line of the file be ignored (e.g. because of header information) (default: true)
  • debug: If set to true, some additional thinks are available: (default false)
  • dumpEachLine: Dumps lines to the console. if set to 1 each line will be dumped
  • measureEachLine: Measures the processing time between n elements that are dumped
  • lastLine/maxLines: Stop processing after n elements are read
  • addlinenumber: Adds the line number (starting with 0) to the beginning of the line. Remember to add a proper attribute to the schema! (default false).
  • xls.floatingFormatter:If used for writing, each double/float value will be formatted using this formatter (default null).
  • xls.numberFormatter: If used for writing, each number other than double/float value will be formatted using this formatter (default null).
  • xls.writeMetadata:Should metadata be written? (default false)
  • xls.trim: Removes leading and trailing whitespaces in each element (default false)

Example

PQL

XLS Protocol Handler
input = ACCESS({source='XLS', 
 wrapper='GenericPull',
 transport='File',
 protocol='XLS',
 dataHandler='Tuple',
 options=[['filename','/home/user/file.xls']],
 schema=[['symbol','String'],['points','Double'] ]
})

output = SENDER({sink = 'XLS',
 wrapper='GenericPush',
 transport='File',
 protocol='XLS',
 dataHandler='Tuple',
 options=[['filename','/home/user/file.xls']],
}, input)

CQL

XLS Protocol Handler
CREATE STREAM xls (symbol String, points Double)   
    WRAPPER 'GenericPull'
    PROTOCOL 'XLS'
    TRANSPORT 'File'
    DATAHANDLER 'Tuple'
    OPTIONS ( 'filename' '/home/user/file.xls')

CREATE SINK writeout (symbol String, points Double)
    WRAPPER 'GenericPush'
    PROTOCOL 'XLS'
    TRANSPORT 'File'
    DATAHANDLER 'Tuple'
    OPTIONS ( 'filename' '/home/user/file.xls')
STREAM TO writeout SELECT * FROM input


  • No labels