Tags:
create new tag
view all tags

SID-01212: Using search to parse text

Status: Answered Answered TWiki version: Perl version:
Category: CategoryApplications Server OS: Last update: 15 years ago

Hi, I was wondering if there's a way to parse a block of text and send it to another page without having to install additional modules or packages.

Basically there's weekly meeting minutes, and I'd like to be able to chop it up according to topic.

I've searched a lot about using formatted search to do this but things have not really clicked, so much appreciated if you could give me some pointers.

Thanks.

-- WeiJiang - 2011-06-23

Discussion and Answer

You could simply enclose text you want to show in another page in %STARTINCLUDE% and %STOPINCLUDE%, then %INCLUDE{}% that topic in another topic. You can also define multiple sections in a page and include the ones you need. See VarINCLUDE, VarSTARTINCLUDE, VarSTARTSECTION.

You can also do a FormattedSearch with a RegularExpression $pattern() to search and pick specific text from a page.

-- PeterThoeny - 2011-06-23

Thanks! I'm using

$pattern(.*?(START.*?END*).*)

in a formatted search.

but it gets me "START blah blah blah END."

How do I exclude START and END and just get "blah blah blah?"

-- WeiJiang - 2011-06-24

$pattern(.*?START(.*?)END.*)

-- PeterThoeny - 2011-06-24

Fantastic. Thank you for your patience!

-- WeiJiang - 2011-06-24

How would one go about this sort of search with a variable name? For example, if I want to parse this:

Apple a fruit that comes in red, yellow, green. AppleEnd Peach has hair. PeachEnd Nectarines doesn't have hair. NectarinesEnd Bananas have potassium BananasEnd

then insert what I get, i.e. "have potassium" into a row of a table corresponding to Banana.

-- WeiJiang - 2011-06-28

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Using search to parse text
SupportCategory CategoryApplications
TWiki version

Server OS

Web server

Perl version

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2011-06-28 - WeiJiang
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.