Skip to Content
author's profile photo Former Member
Former Member

xMII File I/O Importing .CSV file and mapping to columns for querie

Hi,

I am new to xMII and my first assignment is to import a .CSV file using file I/O in the BLS editor and then use that transaction as a data source for a Xacute query. I am able to import the file using the "Get File List", "Text Loader and "Text Saver" functions. After that I parse the file using the "Flat File Parser" function.

At this point I get stuck as I am trying to map the respective fields on the flat file delimited by commas, to their respective columns as identified in the Illuminator Doc.

Please advise as to how I can assign the data delimited by commas to their respective columns. I tried a "Repeater" action block with a "Row" action block that reference the Illuminator Doc but get an invalid Assignment Target error.

Any help will be greatly appreciated

Thanks!

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 26, 2008 at 01:26 PM

    String List to xml

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 26, 2008 at 11:23 PM

    Thanks Christian,

    I am assuming you are saying I should use a repeater action block with a String List to xml action block?

    If my string list looks like this:

    FieldA,FieldB,FieldC

    And my Illuminator doc is configured as:

    HeadingA

    HeadingB

    HeadingC

    How do I manage to assign the contents of FieldA to HeadingA etc? Is this done individually for each column on the query, or is that logic built into BLS i.e. it automatically assign the first field to the first column specified?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      once you have a row of comma delimited fields you can pass it the the string list to XML. The output of the string list to XML action should give you a document were each column has a row, e.g

      Input = FieldA,FieldB,FieldC

      Output =<Rowset>

      <Row>FieldA</Row>

      <Row>FieldB</Row>

      <Row>FieldC</Row>

      </Rowset>

      You can then get the columns you want directly:

      GET_ROW_DATA.Output{/Rowsets/Rowset/Row[1]/Item} is FieldA

      GET_ROW_DATA.Output{/Rowsets/Rowset/Row[2]/Item} is FieldB

      GET_ROW_DATA.Output{/Rowsets/Rowset/Row[3]/Item} is FieldC

  • author's profile photo Former Member
    Former Member
    Posted on Mar 27, 2008 at 05:21 PM

    Hi Christian,

    Thanks for the info. This is quite a learning curve for me - would have been no problem in ABAP;o). Just to help me understand - here is the flow of my action blocks:

    Sequence 1

    Get File List

    Illuminator Doc (I specify the columns here for the query)

    Sequence 2

    Text Loader

    Sequence 3

    Text Saver (Saving the text file here to an archive directory)

    Sequence 4

    Flat File Parser

    Sequence 5

    Repeater (Looping at the parsed flat file in Sequence 4)

    Sequence 6

    String list to XML???

    Sequence 7

    ROW (pointing to the Illuminator Doc)???

    Sequence 8

    Assignment???

    I am not sure if I am using the correct action blocks.

    Can you please advise the correct sequence of the action blocks as well as the configuration from Sequence 6-8?

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 29, 2008 at 07:15 AM

    Hi Christian,

    All seems to be fine right up to the last step where I setup the links in the IlluminatorRow action block.

    Target XPath:

    IlluminatorRow.Column1

    Expression:

    StringListToXml.Output{Rowsets/Rowset/Row[1]/Item

    I follow this format(suggested by you) for each column defined in the Illuminator doc. When I test the transaction though I get the following error:

    Invalid Assignment Target: IlluminatorRow.Column1

    Any ideas?

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 01, 2008 at 04:54 AM

    I defiined all columns as type string so there should be no issue with type as far as I understand.

    I have run out of ideas...

    Add a comment
    10|10000 characters needed characters exceeded

    • When you have an invalid assignment, it means that xMII can't find the action block or field name you are trying to reference. Is your Row action block named IlluminatorRow or something else. If it is something else, rename your mapping to the correct name. An easy way to check if you have mapped one field on the left to one field on the right is to simply highlight the link. If xMII can find both items, it will expand the source and receiving fields.

      There are occasions where renaming does not propagate all the way through the transaction. So you may have to manually update the linkages.

      Hope that helps,

      Mike

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 05:09 AM

    Thanks for the info Michael

    Unfortunately I did all the checks from your email as well but still have the problem.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2008 at 05:58 AM

    Theo

    Carolina 1991

    tbenschatfaritec.com

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.