Re: [PLUG] awk Syntax, Part 2

2012-05-25 Thread Rich Shepard
On Thu, 24 May 2012, Rich Shepard wrote: You would only need the OFS if it was different from the FS like this simple example: I wondered about this. Thanks for clarifying. Update: my script needs both or the output has a space for a separator rather than a pipe. So be it. Regards,

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread Rich Shepard
On Thu, 24 May 2012, Michael Rasmussen wrote: wget target find . -name \*t.z -exec {} /someplace/you/want rm -rf top of tree of wget'd files Michael, This looks to me like post-download processing after the entire site is copied here. I suppose then there's no way of limiting the download

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread Rich Shepard
On Thu, 24 May 2012, Bill Barry wrote: wget has an accept option --accept acclist Bill, I did not see that on the man page; I'll look again. Thanks, Rich ___ PLUG mailing list PLUG@lists.pdxlinux.org

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread wes
On Fri, May 25, 2012 at 6:01 AM, Rich Shepard rshep...@appl-ecosys.comwrote: On Thu, 24 May 2012, Bill Barry wrote: wget has an accept option --accept acclist Bill, I did not see that on the man page; I'll look again. Thanks, Rich my man page has a whole chapter titled Recursive

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, wes wrote: my man page has a whole chapter titled Recursive Accept/Reject Options. however, I would just copy the whole site as Michael suggested until I was sure my end goal had been accomplished. Wes, Bill, Michael: Looking again in the man page I tried to get the

[PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
I've looked in the ORA book and on line without seeing what I've written incorrectly in this script: #! /usr/bin/awk -f BEGIN { FS = OFS = |} if ($3 ~ /Ag/ $4 ~ /0.000/) { print $1, $2, $3, -0.005 }; else if ($3 ~ /Alk_tot/ $4 ~ /0.000/) { print $1, $2, $3, -1.000 }; else if ($3 ~ /Cr/ $4

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Ken Stephens
Rich Shepard wrote: I've looked in the ORA book and on line without seeing what I've written incorrectly in this script: #! /usr/bin/awk -f BEGIN { FS = OFS = |} if ($3 ~ /Ag/ $4 ~ /0.000/) { print $1, $2, $3, -0.005 }; else if ($3 ~ /Alk_tot/ $4 ~ /0.000/) { print $1, $2, $3,

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread Michael Rasmussen
On 2012-05-25 08:03, Rich Shepard wrote: [rshepard@salmo /opt]$ wget -r -A t?z -nH --cut-dirs=1 http://connie.slackware.com/~alien/multilib/13.37/ Please tell me what that command line should be to get only the *.t?z files in the ../13.37/ directory and the compat32/ subdirectory.

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Ken Stephens wrote: BEGIN { FS = OFS = | } I would restate this as: BEGIN { FS = |; OFS = | } Ken, That's the way I had it, but I saw an example using the first syntax and thought it would also work. But, ... I just changed it back and still get the same syntax

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Fred James
Rich Shepard wrote: I've looked in the ORA book and on line without seeing what I've written incorrectly in this script: #! /usr/bin/awk -f BEGIN { FS = OFS = |} if ($3 ~ /Ag/ $4 ~ /0.000/) { print $1, $2, $3, -0.005 }; else if ($3 ~ /Alk_tot/ $4 ~ /0.000/) { print $1, $2, $3, -1.000

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Larry Brigman
On Fri, May 25, 2012 at 10:37 AM, Rich Shepard rshep...@appl-ecosys.com wrote:   I've looked in the ORA book and on line without seeing what I've written incorrectly in this script: #! /usr/bin/awk -f BEGIN { FS = OFS = |} if ($3 ~ /Ag/ $4 ~ /0.000/) { print $1, $2, $3, -0.005 }; else if

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Larry Brigman
On Fri, May 25, 2012 at 11:35 AM, Fred James fredj...@fredjame.cnc.net wrote: Rich Shepard wrote:    I've looked in the ORA book and on line without seeing what I've written incorrectly in this script: #! /usr/bin/awk -f BEGIN { FS = OFS = |} if ($3 ~ /Ag/ $4 ~ /0.000/) { print $1, $2,

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Michael Rasmussen wrote: Since you use t?z your acclist will match any file with tanycharacterz in the name. This matches 36 files in the directory you're searching. These include *txz.asc *txz.md5 *txz and *tgz Scanning the directory listing it seems you only want *tgz

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Fred James wrote: All those semicolons ... ??? ... I don't think that is supported inside a script. Fred, Same errors without them. The awk manual and a couple of other pages note that without the semi-colons in the if ... else if ... else sequence awk doesn't know

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Larry Brigman wrote: I think your problem lies at the end of each if or else if statement as you have a semi-colon which terminates the operation. You can move the semi-colon to inside the } or remove it altogether. awk: ./zero-to-rl.awk:17: else if ($3 ~ /Se/ $4 ~

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Larry Brigman
On Fri, May 25, 2012 at 11:53 AM, Larry Brigman larry.brig...@gmail.com wrote: On Fri, May 25, 2012 at 11:48 AM, Rich Shepard rshep...@appl-ecosys.com wrote: On Fri, 25 May 2012, Larry Brigman wrote: I think your problem lies at the end of each if  or else if statement as you have a

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread Bill Barry
On Fri, May 25, 2012 at 11:43 AM, Rich Shepard rshep...@appl-ecosys.com wrote: On Fri, 25 May 2012, Michael Rasmussen wrote: Since you use t?z your acclist will match any file with tanycharacterz in the name. This matches 36 files in the directory you're searching. These include *txz.asc

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Fred James
Rich Shepard wrote: On Fri, 25 May 2012, Larry Brigman wrote: I think your problem lies at the end of each if or else if statement as you have a semi-colon which terminates the operation. You can move the semi-colon to inside the } or remove it altogether. awk:

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Larry Brigman wrote: Can you post enough of the data to debug this? Larry, Here's a sample: 'A'|'1987-12-12'|'Ag'|0.000| 'A'|'1987-12-12'|'Al'|0.106| 'A'|'1987-12-12'|'CO3'|-1.000| 'A'|'1987-12-12'|'HCO3'|231.000| 'A'|'1987-12-12'|'Alk_tot'|231.000|

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Larry Brigman wrote: You are trying to parse on fields when the fields have not been parsed yet. add { } around your whole conditional list like: {if ... else .. } and move your semi-colons inside the { } for the conditions action. Aha! I tried those one at a

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Fred James wrote: Should the print be something more like: else { print ($1, $2, $3, $4) } Fred, Probably wouldn't hurt, but not necessary. C and Python are so much more block structured than is awk that it's taking me a while to learn just how to write more

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Larry Brigman
On Fri, May 25, 2012 at 1:22 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Fri, 25 May 2012, Larry Brigman wrote: You are trying to parse on fields when the fields have not been parsed yet. add { } around your whole conditional list like: {if ... else .. } and move your

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Bill Barry wrote: The asterisk is critical. -A *tgz,*txz Bill, Ah, I tried the asterisk but not the quotation marks. But, ... [rshepard@salmo /opt]$ wget -r -A *.txz,*.tgz -nH --cut-dirs=1 http://connie.slackware.com/~alien/multilib/13.37/ --2012-05-25

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Larry Brigman wrote: Now that I had some sample code there are a couple of other things here. The resulting output file won't have the trailing | character. Your filters will also output blank lines with | characters. Larry, The output from this script could have the

Re: [PLUG] Download All Specified Files From Website

2012-05-25 Thread Bill Barry
On Fri, May 25, 2012 at 1:38 PM, Rich Shepard rshep...@appl-ecosys.com wrote: . [rshepard@salmo /opt]$ wget -r -A *.txz,*.tgz -nH --cut-dirs=1 http://connie.slackware.com/~alien/multilib/13.37/ This is better wget -r -A *.txz,*.tgz http://connie.slackware.com/~alien/multilib/13.37/ Bill

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Larry Brigman
On Fri, May 25, 2012 at 1:43 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Fri, 25 May 2012, Larry Brigman wrote: Now that I had some sample code there are a couple of other things here. The resulting output file won't have the trailing | character. Your filters will also output blank

Re: [PLUG] awk syntax error, part ii

2012-05-25 Thread Rich Shepard
On Fri, 25 May 2012, Larry Brigman wrote: Well none of the other chemicals had a filter match with a value of 0.000. The only match from the filter for chemical was Cr but it had a -0.006 Ba,Bi and Cd had 0.000 but nothing was in the filter for them. I added two valued to the table to check