Re: [PLUG] Filesystem problems with new USB drive

2018-07-23 Thread John Jason Jordan
On Fri, 20 Jul 2018 22:40:33 -0700 wes dijo: >Under "Item specifics" it still says "Storage Capacity: 256GB" To follow up on the scam, I filed a return request with eBay in which I stated as the reason that they were fake. This morning I got an eBay message from the seller: Dear buyer:

Re: [PLUG] gawk switch statement syntax errors

2018-07-23 Thread Tomas Kuchta
Maybe you can speed things up by pdf2txt and identify the lines of interest in awk. On Mon, Jul 23, 2018, 4:43 PM Rich Shepard wrote: > On Mon, 23 Jul 2018, Tomas Kuchta wrote: > > > Depending on your awk script and/or your data - this can have significant > > runtime impact, beside nicer codi

Re: [PLUG] gawk switch statement syntax errors

2018-07-23 Thread Russell Senior
Making the code more complex than necessary leads to long latencies as you query the plug list. On Mon, Jul 23, 2018, 16:45 Rich Shepard wrote: > On Mon, 23 Jul 2018, Tomas Kuchta wrote: > > > Depending on your awk script and/or your data - this can have significant > > runtime impact, beside ni

Re: [PLUG] gawk switch statement syntax errors

2018-07-23 Thread Rich Shepard
On Mon, 23 Jul 2018, Tomas Kuchta wrote: Depending on your awk script and/or your data - this can have significant runtime impact, beside nicer coding style. Tomas, It takes me 5-10 minutes to highlight data in the PDF file and paste it into a text file. When done the shell script, calling

Re: [PLUG] gawk switch statement syntax errors

2018-07-23 Thread Tomas Kuchta
I hope that I am not beating dead horse with this. There is also performance problem with using case/switch statement like this - the whole code block gets evaluated/run for every record/line. If you use it the way suggested, the code block is only run for the correct record/lines. You can optimi

Re: [PLUG] gawk switch statement syntax errors

2018-07-23 Thread Rich Shepard
On Mon, 23 Jul 2018, Tomas Kuchta wrote: Do not use switch/case - just use NF==35 {print "I see 35 columns on this line"} ... type of a code. If you need more than that you can do something like this: NF==35 && $2<5 {print "I see 35 columns on this line and column 2 is less than 5"} I guess th

Re: [PLUG] gawk switch statement syntax errors

2018-07-23 Thread Tomas Kuchta
Do not use switch/case - just use NF==35 {print "I see 35 columns on this line"} ... type of a code. If you need more than that you can do something like this: NF==35 && $2<5 {print "I see 35 columns on this line and column 2 is less than 5"} I guess that is what Russell was saying too. Tomas O

Re: [PLUG] gawk switch statement syntax errors [RESOLVED]

2018-07-23 Thread Rich Shepard
On Mon, 23 Jul 2018, Russell Senior wrote: Russell, Second, I think you want NF, not NR. Yes. That is correct. Thirdly, I think you want to just write matching rules (mawk manpage didn't mention switch), e.g.: NF == 38 { print stuff } NR == 37 { print other stuff } Sigh. Yes, speci

Re: [PLUG] gawk switch statement syntax errors

2018-07-23 Thread Russell Senior
Ah, gawk does have switch(), but not in compatibility mode. Maybe you are in compatibility mode. But in either case, I don't see the need here (see my "thirdly" suggestion, and ignore my NR == 37 typo). On Mon, Jul 23, 2018 at 12:21 PM, Russell Senior wrote: > First off, I don't have your book

Re: [PLUG] gawk switch statement syntax errors

2018-07-23 Thread Russell Senior
First off, I don't have your book and have no idea what you are trying to do. Second, I think you want NF, not NR. Thirdly, I think you want to just write matching rules (mawk manpage didn't mention switch), e.g.: NF == 38 { print stuff } NR == 37 { print other stuff } Lastly, if the vertic

[PLUG] gawk switch statement syntax errors

2018-07-23 Thread Rich Shepard
gawk-4.1.3 is installed here. According to Arnold Robbins' 'Effective awk Programming, 4th Ed', page 154, the syntax for the switch statement is used in this code: # Get line length (number of fields) switch (NR) { case 36: # No shifts present. { print $1, $6, $7, $8, $9, $10, $11, $12, $1