Forum Discussion

vsunilbabu's avatar
vsunilbabu
New Contributor II
7 years ago

Read a file from one project into a pipeline in another project

I have a file Account.csv in project space called landing. Want to use above file in a pipeline in another project space called staging.

Have found this article:
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438844/File+Reader?showComments=true&showCommentArea=true

where I can use HDFS in expression of Mapper and map it as $FileName and then use File Reader.

Is this possible?

6 Replies

  • mohamadelmardin's avatar
    mohamadelmardin
    New Contributor III

    Thank you @del . This solution resolved my issue.
    So let me put it differently now. Aside from my specific example and assuming that I have just to parse from XML to JSON and write it as-is without using any mapping/transformation to a JSON file to an external system but with the array format always enforced even with one element, Is there a way to do it in the XML parser by let us say for example checking the validate against XSD schema? Or do I have to use a mapper always to clean it and enforce the array on it?

    The reason I am asking again because the XML I gave was just a simple example but in my real scenario the XML payload I am working in has more than a 100 elements and multiple nested array structure. so that means I have to use a mapper for each expected array in order to check it and use the [].concat[element] on it ?!

    • nshruthi's avatar
      nshruthi
      New Contributor II

      Hi,

      Am also looking for solution for similar kind of issue with multiple elements having array structure, Did you find any solution in xml parser or added multiple mappers?

      TIA,
      Shruthi

      • mohamadelmardin's avatar
        mohamadelmardin
        New Contributor III

        @nshruthi
        No I didn’t. Unfortunately SnapLogic doesn’t have an out-of-box solution in the XML parser to handle XML array transformation gracefully. I have an enhancement request opened with support but I haven’t heard any resolution on it yet and still waiting…