Extract a line or multiple lines from a text

Questions and Answers about programming Helium Scraper.
Post Reply
edvukass
Posts: 13
Joined: Wed Jan 30, 2013 3:58 pm

Extract a line or multiple lines from a text

Post by edvukass » Mon Feb 04, 2013 11:08 am

Hi is there a way to extract a line or multiple lines from a text?

webmaster
Site Admin
Posts: 479
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Extract a line or multiple lines from a text

Post by webmaster » Mon Feb 11, 2013 5:56 pm

You can use text gatherers at Project -> Text Gatherers. To extract, say, the first line, you'd create a text gatherer (call it "FirstLine"), then select Add Step -> Slice. Then save it and, on your Extract action, instead of extracting the Text property, extract the JS_FirstLine property. If you want to extract, say, everything after the first line, you'd use a Regular Expression step (instead of a Slice one) with this expression:

Code: Select all

\n((.|\n)+)
And select 1 in the Group Position.
Juan Soldi
The Helium Scraper Team

Post Reply