<div dir="ltr">Peter,<div style>I have copied your files Test.LocCode and Test.Loc1, Test.Loc2 and Test.Loc3 to my site. I copied the wikish command to a new page Plants.Plant001. I changed the grep source as shown below.</div>
<div style><div>{(wikish echo "|| border=1"; grep '\(:location.*x=.*y=' Plants.Plant? | sed -e 's/^/||/' -e 's/:\(:/||/' -e 's/ x=/||/' -e 's/ y=/||y=/' -e 's/:\).*$/||/';)}</div>
<div><br></div><div style>I get the error</div><div style><span style="color:rgb(65,65,65);font-family:Arial,Helvetica,sans-serif;font-size:13px;line-height:20.46875px;text-align:center;background-color:rgb(237,232,226)">WikiSh.Read: Unable to read Plants.Plant?. Does not exist.</span><br>
</div><div style>Sorry for the newbie question, but what is the syntax error?<br></div><div style><br></div><div style>Another question... I am able to set a single variable equal to a line selected with grep using the set command in wikish. Is there a way to parse the variable and to push results into a set of arrays. For example, each location line has a x= and y= value, and I would like to push x and y values into separate arrays like I do in php. Is this something that can be done with functions in wikish?</div>
<div style><br></div><div style>-Mark</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 28, 2013 at 11:39 PM, Mark Lee <span dir="ltr"><<a href="mailto:mark.lee.phd@gmail.com" target="_blank">mark.lee.phd@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thank you Peter! Amazing. That example is so helpful. I'm glad I found pmwiki.<span class="HOEnZb"><font color="#888888"><br>
</font></span></div><span class="HOEnZb"><font color="#888888">-Mark<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 28, 2013 at 11:14 PM, Peter Bowers <span dir="ltr"><<a href="mailto:pbowers@pobox.com" target="_blank">pbowers@pobox.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra">On Tue, May 28, 2013 at 9:32 PM, Mark Lee <<a href="mailto:mark.lee.phd@gmail.com" target="_blank">mark.lee.phd@gmail.com</a>> wrote:<br>

><br>> I am new to wikish. Is it possible to do the following with wikish?<br>

><br>> A subset of pages in a group have this markup on the page.<br>><br>> (:location x=1 y=2:)<br>> (:location x=10 y=10:)<br>> (:location x=20 y=5)<br>> etc...<br>><br>> 1. What is the code for listing out the locations, one per line, along with the pagenames, excluding all pages without the (:loaction:) markup. For example:<br>



><br>> Group:Group1<br>> Pagename=Name1, x=1, y=2<br>> Pagename=Name1, x=10, y=10<br>> Pagename=Name1, x=20, y=5<br>> Pagename=Name6, x=3, y=15<br>> Pagename=Name82, x=5, y=70<br>> Pagename=Name82, x=2, y=40<br>



> etc...<br><br></div></div><div class="gmail_extra">grep '\(:location.*x=.*y=' Group1.*<br></div><div><div class="gmail_extra"><br>> 2. Is it possible to format the output as a table?<br><br></div>
</div><div class="gmail_extra">

Several ways.  Here's one (approximate):<br></div><div class="gmail_extra"><br><div class="gmail_extra">grep 'location.*x=.*y=' Group1.* | sed -e 's/^/||/' -e 's/:\(:/||/' -e 's/ x=/||x=' -e 's/ y=/||y=' -e 's/:\).*$/||'<br>



<br></div><div class="gmail_extra">See <a href="http://pmwiki.qdk.org/pmwiki.php?n=Test.LocCode" target="_blank">http://pmwiki.qdk.org/pmwiki.php?n=Test.LocCode</a> for a working example with 3 pages of test data.<br></div>

<div><br>> 3. Is it possible to pipe the result to additional wikish code or a php function?<br>

<br></div></div><div class="gmail_extra">Always possible to pipe it to additional wikish.  Or put that value in a wikish variable (or pv or ptv) and then further manipulate it.  Or put it into Tmp pages (which are available for wikish access and manipulation but don't exist otherwise).  Or etc.<br>



<br>To mess with it in a php function probably you would want to bind your function to a markup expression and then pipe data to/from wikish using standard wikish conventions.  You can look at <a href="http://www.pmwiki.org/wiki/Cookbook/MiscMX" target="_blank">http://www.pmwiki.org/wiki/Cookbook/MiscMX</a> for some fairly minimalized examples to work off of.<span><font color="#888888"><br>



<br></font></span></div><span><font color="#888888"><div class="gmail_extra">-Peter<br></div></font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>