Re: counting commas

2024-01-21 Thread Charlie Gibbs
On Sun Jan 21 10:12:00 2024 John Hasler wrote: > Roy J. Tellason writes: >> Where does that leave those of us that wrote c for CP/M? > I wrote: >> Or for MTS? > Gene writes: >> That, i've not heard of John, please expand. > > Michigan Terminal System. A multi-user OS running on the Amdahl >

Re: counting commas

2024-01-20 Thread gene heskett
On 1/20/24 19:28, John Hasler wrote: Roy J. Tellason writes: Where does that leave those of us that wrote c for CP/M? I wrote: Or for MTS? Gene writes: That, i've not heard of John, please expand. Michigan Terminal System. A multi-user OS running on the Amdahl 470V/6 at the University of

Re: counting commas

2024-01-20 Thread John Hasler
Roy J. Tellason writes: > Where does that leave those of us that wrote c for CP/M? I wrote: > Or for MTS? Gene writes: > That, i've not heard of John, please expand. Michigan Terminal System. A multi-user OS running on the Amdahl 470V/6 at the University of Michigan. -- John Hasler

Re: counting commas

2024-01-20 Thread gene heskett
On 1/20/24 19:02, John Hasler wrote: Roy J. Tellason writes: Where does that leave those of us that wrote c for CP/M? Or for MTS? That, i've not heard of John, please expand. Cheers, Gene Heskett. -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo.

Re: counting commas

2024-01-20 Thread John Hasler
Roy J. Tellason writes: > Where does that leave those of us that wrote c for CP/M? Or for MTS? -- John Hasler j...@sugarbit.com Elmwood, WI USA

Re: counting commas

2024-01-20 Thread gene heskett
On 1/20/24 15:40, Roy J. Tellason, Sr. wrote: On Friday 19 January 2024 09:48:01 pm Nicholas Geovanis wrote: On Fri, Jan 19, 2024, 2:07 PM Thomas Schmitt wrote: . (Ok, C causes scars on the programmer's self esteem. But what does not kill me makes me just stronger. I'm a vim user.)

Re: counting commas

2024-01-20 Thread Roy J. Tellason, Sr.
On Friday 19 January 2024 09:48:01 pm Nicholas Geovanis wrote: > On Fri, Jan 19, 2024, 2:07 PM Thomas Schmitt wrote: > > > . > > (Ok, C causes scars on the programmer's self esteem. But what does not > > kill me makes me just stronger. I'm a vim user.) > > > > OK I'll mention that to my

Re: counting commas

2024-01-20 Thread David Wright
On Sat 20 Jan 2024 at 17:09:58 (-), Curt wrote: > On 2024-01-19, David Wright wrote: > > On Fri 19 Jan 2024 at 17:25:10 (+), debian-u...@howorth.org.uk wrote: > >> Greg Wooledge wrote: > >> > >> > I won, and you lost > >> > >> There shouldn't be a comma in that sentence, in English.

Re: counting commas

2024-01-20 Thread fxkl47BF
On Sat, 20 Jan 2024, Greg Wooledge wrote: > On Sat, Jan 20, 2024 at 05:09:58PM -, Curt wrote: >> On 2024-01-19, David Wright wrote: >>> On Fri 19 Jan 2024 at 17:25:10 (+), debian-u...@howorth.org.uk wrote: Greg Wooledge wrote: > I won, and you lost There

Re: counting commas

2024-01-20 Thread Curt
On 2024-01-20, Greg Wooledge wrote: > > Regardless of which grammar rules are right, wrong, or optional, the point > of this is that parsing natural language text is *stupidly difficult*. > A person who has to ask why "grep -c" doesn't count the number of commas > in a single line of text

Re: counting commas

2024-01-20 Thread Greg Wooledge
On Sat, Jan 20, 2024 at 05:09:58PM -, Curt wrote: > On 2024-01-19, David Wright wrote: > > On Fri 19 Jan 2024 at 17:25:10 (+), debian-u...@howorth.org.uk wrote: > >> Greg Wooledge wrote: > >> > >> > I won, and you lost > >> > >> There shouldn't be a comma in that sentence, in English.

Re: counting commas

2024-01-20 Thread Curt
On 2024-01-19, David Wright wrote: > On Fri 19 Jan 2024 at 17:25:10 (+), debian-u...@howorth.org.uk wrote: >> Greg Wooledge wrote: >> >> > I won, and you lost >> >> There shouldn't be a comma in that sentence, in English. There is in >> the closely related expression "I won, you lost." > >

Re: counting commas

2024-01-19 Thread gene heskett
On 1/19/24 21:48, Nicholas Geovanis wrote: On Fri, Jan 19, 2024, 2:07 PM Thomas Schmitt > wrote: . (Ok, C causes scars on the programmer's self esteem. But what does not kill me makes me just stronger. I'm a vim user.) OK I'll mention that to my

Re: counting commas

2024-01-19 Thread gene heskett
On 1/19/24 21:48, Nicholas Geovanis wrote: On Fri, Jan 19, 2024, 2:07 PM Thomas Schmitt > wrote: . (Ok, C causes scars on the programmer's self esteem. But what does not kill me makes me just stronger. I'm a vim user.) OK I'll mention that to my

Re: counting commas

2024-01-19 Thread Nicholas Geovanis
On Fri, Jan 19, 2024, 9:24 PM John Hasler wrote: > > Another SPITBOL user lives??!? :-) > > It's been decades since I used it. > > > It should all be open-source by now > > Is it? > > http://www.snobol4.com/ > > A search finds this: > Well thank you so much John. They are giving away for

Re: counting commas

2024-01-19 Thread Nicholas Geovanis
On Fri, Jan 19, 2024, 6:52 PM John Hasler wrote: > debian-u...@howorth.org.uk writes: > > The > > At the risk of being seen as old-fashioned, but as a user of both > > languages, I think Perl is a much better choice than C for string > > processing. > > Use SPITBOL. > Another SPITBOL user

Re: counting commas

2024-01-19 Thread Nicholas Geovanis
On Fri, Jan 19, 2024, 2:07 PM Thomas Schmitt wrote: > . (Ok, C causes scars on the programmer's self esteem. But what does not > kill me makes me just stronger. I'm a vim user.) > OK I'll mention that to my psychiatrist :-) But the C programmers I knew were either really nice guys if they

Re: counting commas

2024-01-19 Thread Cindy Sue Causey
On 1/19/24, David Wright wrote: > On Fri 19 Jan 2024 at 17:25:10 (+), debian-u...@howorth.org.uk wrote: >> Greg Wooledge wrote: >> >> > I won, and you lost >> >> There shouldn't be a comma in that sentence, in English. There is in >> the closely related expression "I won, you lost." > >

Re: counting commas

2024-01-19 Thread Peter Hillier-Brook
On 19/01/2024 23:02, David Wright wrote: On Fri 19 Jan 2024 at 17:25:10 (+), debian-u...@howorth.org.uk wrote: Greg Wooledge wrote: I won, and you lost There shouldn't be a comma in that sentence, in English. There is in the closely related expression "I won, you lost." Anything

Re: counting commas

2024-01-19 Thread David Wright
On Fri 19 Jan 2024 at 17:25:10 (+), debian-u...@howorth.org.uk wrote: > Greg Wooledge wrote: > > > I won, and you lost > > There shouldn't be a comma in that sentence, in English. There is in > the closely related expression "I won, you lost." That's rather proscriptive. "I won and you

Re: counting commas

2024-01-19 Thread John Hasler
debian-u...@howorth.org.uk writes: > There shouldn't be a comma in that sentence, in English. There is in > the closely related expression "I won, you lost." The program has to be able to deal with bad writing. > At the risk of being seen as old-fashioned, but as a user of both > languages, I

Re: counting commas

2024-01-19 Thread fxkl47BF
On Fri, 19 Jan 2024, Greg Wooledge wrote: > On Fri, Jan 19, 2024 at 03:30:17PM +, fxkl4...@protonmail.com wrote: But at this point, we have to wonder what the *actual* goal is. >> >> to exclude phrases with commas for seperate examination > > Parsing natural language text is going to be

Re: counting commas

2024-01-19 Thread debian-user
Greg Wooledge wrote: > I won, and you lost There shouldn't be a comma in that sentence, in English. There is in the closely related expression "I won, you lost." > I really don't think I'd try this with shell scripts. The tools just > aren't designed for this. You really want tools that are

Re: counting commas

2024-01-19 Thread Greg Wooledge
On Fri, Jan 19, 2024 at 03:30:17PM +, fxkl4...@protonmail.com wrote: > >> But at this point, we have to wonder what the *actual* goal is. > > to exclude phrases with commas for seperate examination Parsing natural language text is going to be tricky. I can only talk about English, and not

Re: counting commas

2024-01-19 Thread fxkl47BF
On Fri, 19 Jan 2024, Thomas Schmitt wrote: > Hi, > > Greg Wooledge wrote: >> unicorn:~$ string="apple,banana,cherry,date" >> unicorn:~$ commas=${string//[!,]/} >> unicorn:~$ echo "${#commas}" >> 3 > > Always astonishing what a good bashism can do. > > >> But at this point, we have to wonder what

Re: counting commas

2024-01-19 Thread Thomas Schmitt
Hi, Greg Wooledge wrote: > unicorn:~$ string="apple,banana,cherry,date" > unicorn:~$ commas=${string//[!,]/} > unicorn:~$ echo "${#commas}" > 3 Always astonishing what a good bashism can do. > But at this point, we have to wonder what the *actual* goal is. Up to now we only know about the

Re: counting commas

2024-01-19 Thread Greg Wooledge
On Fri, Jan 19, 2024 at 09:25:14AM +0100, Thomas Schmitt wrote: > An answer to this question > > https://stackoverflow.com/questions/16679369/count-occurrences-of-a-char-in-a-string-using-bash > proposes > echo "referee" | tr -cd 'e' | wc -c > > $ echo ',,,' | tr -cd ',' | wc -c > 3

Re: counting commas

2024-01-19 Thread Michael Grant
On Fri, Jan 19, 2024 at 09:25:14AM +0100, Thomas Schmitt wrote: > fxkl4...@protonmail.com wrote: > > why doesn't grep count 2 commas > > echo 'Kích thước máy xay cỏ, giá máy thế nào , phụ tùng máy mua ở đâu' | > > grep -c , > > 1 Here's my way: $ echo 'Kích thước máy xay cỏ, giá máy thế nào ,

Re: counting commas

2024-01-19 Thread Thomas Schmitt
Hi, fxkl4...@protonmail.com wrote: > why doesn't grep count 2 commas > echo 'Kích thước máy xay cỏ, giá máy thế nào , phụ tùng máy mua ở đâu' | > grep -c , > 1 Happens with much simpler text too: $ echo ',,,' | grep -c ',' 1 The man page explains it: -c, --count Suppress normal

Re: counting commas

2024-01-19 Thread tomas
On Fri, Jan 19, 2024 at 07:10:51AM +, fxkl4...@protonmail.com wrote: > why doesn't grep count 2 commas > > > echo 'Kích thước máy xay cỏ, giá máy thế nào , phụ tùng máy mua ở đâu' | grep > -c , > 1 > > echo 'Kích thước máy xay cỏ, giá máy thế nào , phụ tùng máy mua ở đâu' | cut > -d, -f1

Re: counting commas

2024-01-18 Thread John Crawley
On 19/01/2024 16:10, fxkl4...@protonmail.com wrote: why doesn't grep count 2 commas echo 'Kích thước máy xay cỏ, giá máy thế nào , phụ tùng máy mua ở đâu' | grep -c , 1 echo 'Kích thước máy xay cỏ, giá máy thế nào , phụ tùng máy mua ở đâu' | cut -d, -f1 Kích thước máy xay cỏ echo 'Kích