Customer Portal

Dynamic file name in Reader?

Comments 2

  • Avatar
    oldforum
    0
    Comment actions Permalink
    These are some great ideas - thanks for taking the time to respond.

    I think we'll start with the simple script iteration, and then look at extending the XLSReader to accept multiple files. Our files should be named in a predictable pattern - so using the wild-card file matching for a multi-file reader should work. I'll look at the other readers for examples.

    thanks

    cliff
  • Avatar
    oldforum
    0
    Comment actions Permalink
    Hello Cliff,
    unfortunately clover is not suitable to iterate some part of the transformation graph, nevertheless there are some ways to solve your task. Most of reader components in the latest clover engine release 2.1 are available to read from multifile defined by list or file mask (i.e. 'data1.txt;data2.txt;data3.txt' or 'data*.txt'), unfortunately XSLReader is not, but this extension is not hard to implement. But if you realy don't know anything about input files, you could use ability to set fileURL attribute by parameter. In the first graph you can for example generate through the use of Structure writer component parameter file:

    XLS_TO_READ=data1.xls;data2.xls;data3.xls

    And second graph use this file to setup fileURL of your reader (this solution of course supposes extension in XSLReader for multi-file reading).

    Only solution without changes of clover engine is in using some shell script, which implements required iteration outside clover:

    runGraph <graph_generates_input_file_name_list>
    for i in `cat filenames`; do
    runGraph -D:FILEURL=$i <graph_concatenating_data_to_the_one_destination(use CloverWriter)>
    done

    runGraph <read(use CloverReader)_all_data_and_aggregate>

    Don't hesitate and ask me in case any question.

    OtaSanek

Please sign in to leave a comment.