Re: Does words have a delimiter?

2018-04-13 Thread Brandon Allbery
"words" is just a shorthand for a common invocation of "split", really. On Sat, Apr 14, 2018 at 1:27 AM, ToddAndMargo wrote: > Hi All, > > I am over on > https://docs.perl6.org/routine/words > and I can't make heads of tails out of it. > > Does "words" have a delimiter, as does "-F" with awk

Re: Does words have a delimiter?

2018-04-13 Thread Jonathan Scott Duff
Looking at that page myself, it doesn't appear that you can specify the separator for .words. So ... no. Though, that would make an interesting addition IMHO -Scott On Sat, Apr 14, 2018 at 12:27 AM, ToddAndMargo wrote: > Hi All, > > I am over on > https://docs.perl6.org/routine/words > an

Does words have a delimiter?

2018-04-13 Thread ToddAndMargo
Hi All, I am over on https://docs.perl6.org/routine/words and I can't make heads of tails out of it. Does "words" have a delimiter, as does "-F" with awk? Many thanks, -T

Re: awk?

2018-04-13 Thread ToddAndMargo
On 04/13/2018 04:13 AM, Fernando Santagata wrote: "There's More Than One Way To Do It" The definition of Perl! :-)

Re: awk?

2018-04-13 Thread ToddAndMargo
On Friday, April 13, Fernando Santagata wrote: Hi, Since "There's More Than One Way To Do It", one can look for the value, instead of the separator: $ echo "total kB 1804482980 112" |perl6 -n -e 'say .comb(/\d+/)[1]' 2980 On Fri, Apr 13, 2018 at 12:31 PM, Shlomi Fish wrote:

Re: awk?

2018-04-13 Thread ToddAndMargo
On Fri, Apr 13, 2018 at 12:31 PM, Shlomi Fish > wrote: Hi Todd, On Fri, 13 Apr 2018 03:00:22 -0700 ToddAndMargo mailto:toddandma...@zoho.com>> wrote: > echo "total kB 1804482980 112" | awk '{print $4}') shlomif[Perl6]:$tru

Re: awk?

2018-04-13 Thread ToddAndMargo
On 04/13/2018 03:31 AM, Shlomi Fish wrote: Hi Todd, On Fri, 13 Apr 2018 03:00:22 -0700 ToddAndMargo wrote: echo "total kB 1804482980 112" | awk '{print $4}') shlomif[Perl6]:$trunk$ echo "total kB 1804482980 112" | perl6 -n -e 'say .split(/\s+/)[3]' 2980 s

Re: how do I do an integer divide?

2018-04-13 Thread ToddAndMargo
On Fri, 13 Apr 2018 at 11:07 ToddAndMargo > wrote: How do I do and integer divide? On 04/13/2018 03:09 AM, Simon Proctor wrote: It's div (lowercase) so 21 div 4 = 5 :) That was easy. Thank you! -- ~~ Computers are like

Re: awk?

2018-04-13 Thread Brian Duggan
One could also use .words -- $ echo "total kB 1804482980 112" |perl6 -n -e 'say .words[3]' 2980 Brian On Friday, April 13, Fernando Santagata wrote: > Hi, > > Since "There's More Than One Way To Do It", one can look for the value, > instead of the separator: > > $ echo "total

Re: awk?

2018-04-13 Thread Fernando Santagata
Hi, Since "There's More Than One Way To Do It", one can look for the value, instead of the separator: $ echo "total kB 1804482980 112" |perl6 -n -e 'say .comb(/\d+/)[1]' 2980 On Fri, Apr 13, 2018 at 12:31 PM, Shlomi Fish wrote: > Hi Todd, > > On Fri, 13 Apr 2018 03:00:22 -070

Fw: awk?

2018-04-13 Thread Shlomi Fish
Begin forwarded message: Date: Fri, 13 Apr 2018 13:31:12 +0300 From: Shlomi Fish To: perl6-users@perl.org Subject: Re: awk? Hi Todd, On Fri, 13 Apr 2018 03:00:22 -0700 ToddAndMargo wrote: > echo "total kB 1804482980 112" | awk '{print $4}') shlomif[Perl6]:$trunk$ echo "

Re: awk?

2018-04-13 Thread Shlomi Fish
Hi Todd, On Fri, 13 Apr 2018 03:00:22 -0700 ToddAndMargo wrote: > echo "total kB 1804482980 112" | awk '{print $4}') shlomif[Perl6]:$trunk$ echo "total kB 1804482980 112" | perl6 -n -e 'say .split(/\s+/)[3]' 2980 shlomif[Perl6]:$trunk$ echo "total kB

Re: how do I do an integer divide?

2018-04-13 Thread Simon Proctor
It's div (lowercase) so 21 div 4 = 5 :) On Fri, 13 Apr 2018 at 11:07 ToddAndMargo wrote: > Hi All, > > How do I do and integer divide? > > By that I mean I want only the whole number and > not the decimal point or the fraction. > > 21 DIV 4 = 5 (not 5.25) > 21 % 4 = 1 (remainder = 1) > > >

how do I do an integer divide?

2018-04-13 Thread ToddAndMargo
Hi All, How do I do and integer divide? By that I mean I want only the whole number and not the decimal point or the fraction. 21 DIV 4 = 5 (not 5.25) 21 % 4 = 1 (remainder = 1) Many thanks, -T

awk?

2018-04-13 Thread ToddAndMargo
Hi All, How to I translate this to Perl 6? I am looking to be able to dig out the fourth (or any) data point. #!bin/bash $x=$(echo "total kB 1804482980 112" | awk '{print $4}') echo $x 2980 Many thanks, -T