Forum Discussion

darshthakkar's avatar
darshthakkar
Valued Contributor
3 years ago
Solved

Converting value of input schema to distinct columns

Hi Team,

I’m reading a text file and wanted to fetch DISTINCT columns out of the data itself, screenshot below for your reference.

.txt file:

When I read the above data in snaplogic, the format is:

Tried with $.merge(), GroupByN, CSV parse (contains headers) and Aggregrate (Concat) but didn’t find any luck.

Any suggestions over here?
Thank you.

Regards,
Darsh

  • Thank you @koryknick, the solution worked.
    I happen to tweak the expression in the mapper a bit so that no extra spaces were observed:

    Yes, the text file will always have “x” fields, it wouldn’t even go to x-1 or x+1.

    Moreover, as there is no max value in a group size as per documentation, I can pretty much keep it to 100 for instance to handle the additional rows coming in the future. What are your thoughts?
    Intentionally, kept 100 and not 99999999 as I’m not anticipating anything more than 8.

    Thank you.

    Regards,
    Darsh

10 Replies

  • ash42's avatar
    ash42
    New Contributor III

    No luck, Same error

    • darshthakkar's avatar
      darshthakkar
      Valued Contributor

      With these settings, can you write a file to the existing directory?
      If yes, may be check with your admin if you’ve rights to create a directory in that location.

      The settings look good to me as I’ve been able to create directories with the same.

      • ash42's avatar
        ash42
        New Contributor III

        I did connect to the ftp server with the same credentials ,and tried creating a folder manually…I was able to create…Dont know why through snaplogic I am not able to create with same credentials