12-13-2023 08:59 PM
I am trying to parse a file with a complex format. It hasn't been easy as I am new to Snaplogic. In the below example, I am trying to combine the four rows. In order to do that I am thinking to assign the same seqeunce number to the group highlighted in yellow then use Aggregate to combine based on the sequence number. How do I generate the sequence number?
Solved! Go to Solution.
12-15-2023 11:15 AM
My apologies - attached here.
12-14-2023 04:06 AM
@GanguP - SnapLogic is a streaming platform, meaning it only retains context of the current document being processed. I'd like to fully understand the requirement before showing you one solution vs another.
Before offering a solution, can you clarify your use case? Do you need to always combine 4 rows following a blank linedata value? Or could there be any number of rows (0-N)?
12-14-2023 06:12 AM
Hi Kory. Thank you for a quick response. Below is the format of the file I am trying to parse. Below are the steps I am taking
1) Use Fixed width parser to filter out lines that are not needed.
2) Used mapper to assign the LOCATOR2_FLAG. Below is the logic.
($LINEDATA.substring(0,9).trim()>='0000000000' && $LINEDATA.substring(0,9).trim()<='9999999999') &&$LINEDATA.substr(38,1) .trim() == "-"?'Y':'N'
12-14-2023 06:46 AM
@GanguP - could you please attach the file to this thread? Or at least a portion of it? I'd like to create a solution for you but would rather not hand-enter all the data from your sample.
12-14-2023 06:50 AM