Using GREP commands (or maybe not)

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Using GREP commands (or maybe not)

Post by Andycal » Mon Jan 11, 2010 12:48 pm

Hiya all,

Been playing with GREP on linux to rip through some files and extract the 'title', 'keywords' and 'description' tag out of web pages. I now want to convert this to RunRev to create a desktop application, but I'm having problems with the filter command.

We got to this on Linux:

find ./ -name 'meta.inc.php' -exec grep "<meta name=\"des.*>" {} \; | grep -o "content=\"[^\"]*\"" | grep -Eo "\".*\"" | xargs echo

As you can see, this goes through grep three times to seperate out the relevant text, but I'm having trouble converting this to RunRev. I've tried lots of different ways as I imagined it's the quotes throwing it out so done all that "& quote &" stuff but still to no avail.

Anyone got any ideas? My end result will be a function that will examine the file (or URL) and display all three tags.

If it's tempting, I've got a bit of pocket money to throw at this if anyone can come up with a solution. PM me if you're interested.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Using GREP commands (or maybe not)

Post by Mark » Mon Jan 11, 2010 1:51 pm

Hi Andycal,

Since you have the shell syntax already, I think that using the shell() function is the obvious solution.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Re: Using GREP commands (or maybe not)

Post by Andycal » Mon Jan 11, 2010 1:58 pm

Problem is, we want to run this on Windows so there's no guarantee it'll have grep installed.

Post Reply