How to seperate text output in openrouter that is along string to mapable seperate outputs

hi there

Recently i generated a long string as output for news and i want to seperate them page by page there are 7 page currently, how to seperate them, please suggest some effective methods since i m low on my operations.

heres the output bundle:

[ { "text": "Page 1: Heading: \"LSG Seeks Redemption in Hyderabad\" \nDescription: After a humiliating 10-wicket loss last season, LSG aims to create better memories in Hyderabad this time around. \n\nPage 2: Heading: \"A Bitter After-Taste Remains\" \nDescription: The previous match at the venue left LSG with a bitter taste, but they're determined to turn things around. \n\nPage 3: Heading: \"Challenges Ahead for LSG\" \nDescription: With key players missing, LSG faces an uphill battle in their quest for redemption in Hyderabad. \n\nPage 4: Heading: \"Key Players Absent\" \nDescription: Injuries and unavailability of star players add to LSG's woes ahead of the crucial match. \n\nPage 5: Heading: \"Strategies to Overcome\" \nDescription: LSG will need to rely on teamwork and smart strategies to compensate for the missing talent. \n\nPage 6: Heading: \"Opponent's Stronghold\" \nDescription: Hyderabad's home advantage and strong lineup pose a significant threat to LSG's redemption hopes. \n\nPage 7: Heading: \"Fans Await a Turnaround\" \nDescription: LSG fans are hopeful their team will rise to the occasion and make this season unforgettable." } ]

Hey Amrita,

easiest would be to use the split() function and split it by “Page”. This will turn the string into an array, then you can use the order index to map the individual pages where needed.

thanks! could u guide me how to do it , which module do i have to use ( suppose text parser- match pattern or iterator and set variable).

@Stoyan_Vatov

Also i tried using iterator and got output bundle as: [
{
“value”: "split_pages ",
“IMTINDEX”: 1,
“IMTLENGTH”: 1
}
]

@Stoyan_Vatov

Also heres my output of set variable:

output bundle of tool: [
{
“split_pages”: “split(Page 1: Heading: "Titans vs North West Live" Description: "Catch live updates of the 24th Match in CSA Four-Day Series Division One 2024-25." \nPage 2: Heading: "Key Match Details" Description: "The match starts on Mar 27, featuring Titans vs North West in Division One." \nPage 3: Heading: "Live Score Updates" Description: "Follow ball-by-ball commentary and real-time scores on Cricbuzz." \nPage 4: Heading: "Teams in Action" Description: "Titans and North West battle for supremacy in this four-day clash." \nPage 5: Heading: "CSA Four-Day Series" Description: "Part of the Division One fixtures, this match promises intense cricket." \nPage 6: Heading: "Player Performances" Description: "Watch out for standout performances from both teams in this encounter." \nPage 7: Heading: "Stay Tuned" Description: "Don’t miss the thrilling conclusion of this four-day cricket match."; "Page")”
}
]

Here’s my scenario:

Doesn’t look like you used the split function there. Try selecting it from the menu under Text and Binary functions. It should look like this:

1 Like

please hold there, just testing…

@Stoyan_Vatov

should i use iterator after that.

You can type the split formula directly in the input field of the iterator module.

@Stoyan_Vatov

also after testing, the result comming is showing as whole not like seperated from 1 to 7, but only one1:

@Stoyan_Vatov

looks like it workd for me but also shows this


;

i want to get them as seperate items so they can be used seperately for different google docs.

They are separate bundles in your screenshot? Just map the Value variable in the content field and the Google Docs module will run 7 times creating a new Doc for each page.

thanks @Stoyan_Vatov
the issue is finally resolved

1 Like