Timeline for How to count the lines containing one of two words but not both
Current License: CC BY-SA 4.0
29 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 11, 2021 at 4:52 | comment | added | Hopping Bunny | Nice. In GNU grep 3.4, I found that I can omit \< and \> like so: cat poem.txt | grep -Evi -e 'an .* the' -e 'the.* an' | grep -Eci -e '(an|the)' | |
| Feb 5, 2021 at 12:35 | history | edited | CookiePatriot | CC BY-SA 4.0 | added 10 characters in body |
| Feb 5, 2021 at 11:39 | history | edited | CookiePatriot | CC BY-SA 4.0 | added 367 characters in body |
| Feb 5, 2021 at 11:36 | vote | accept | CookiePatriot | ||
| Feb 5, 2021 at 2:39 | answer | added | Ed Morton | timeline score: 4 | |
| Feb 5, 2021 at 2:20 | comment | added | Ed Morton | Is best-selling one word or 2 (or even 3 - best, selling, and best-selling)? As always with these sorts of questions the definition of a "word" is key. | |
| Feb 4, 2021 at 20:08 | answer | added | TigerTV.ru | timeline score: 2 | |
| Feb 4, 2021 at 2:22 | answer | added | guest_7 | timeline score: 2 | |
| Feb 3, 2021 at 20:29 | history | became hot network question | |||
| Feb 3, 2021 at 20:04 | history | edited | user232326 | CC BY-SA 4.0 | Fix the problem of incorrect count (is 9). |
| Feb 3, 2021 at 19:40 | answer | added | user232326 | timeline score: 2 | |
| Feb 3, 2021 at 18:38 | answer | added | user313992 | timeline score: 3 | |
| Feb 3, 2021 at 16:12 | history | edited | CookiePatriot | CC BY-SA 4.0 | added 119 characters in body |
| Feb 3, 2021 at 15:03 | answer | added | rowboat | timeline score: 10 | |
| Feb 3, 2021 at 14:05 | answer | added | theCalcaholic | timeline score: 8 | |
| Feb 3, 2021 at 13:55 | history | edited | AdminBee | CC BY-SA 4.0 | Adapt formatting, rephrase to "merge" the edited parts into one more or less seamless text |
| Feb 3, 2021 at 13:46 | answer | added | AdminBee | timeline score: 6 | |
| Feb 3, 2021 at 13:36 | history | edited | CookiePatriot | CC BY-SA 4.0 | added 300 characters in body |
| Feb 3, 2021 at 13:36 | comment | added | FelixJN | What about two occuences of the word? (e.g. The & the on line 3) How about case sensitivity? | |
| Feb 3, 2021 at 13:36 | history | edited | CookiePatriot | CC BY-SA 4.0 | added 300 characters in body |
| Feb 3, 2021 at 13:25 | comment | added | berndbausch | grep -c the poem.txt | grep -c an poem.txt does not what you expect. It first counts the number of lines with the. The output, i.e. the number, is piped into a second grep, which ignores its input. It counts the lines containing an and outputs that. Besides, the two grep commands also count lines that contain there or demand. | |
| Feb 3, 2021 at 13:25 | history | edited | muru | CC BY-SA 4.0 | formatting, some capitalization and grammar. |
| S Feb 3, 2021 at 13:24 | history | suggested | berndbausch | CC BY-SA 4.0 | formatting, some capitalization and grammar. |
| Feb 3, 2021 at 13:23 | review | Suggested edits | |||
| S Feb 3, 2021 at 13:24 | |||||
| Feb 3, 2021 at 13:18 | history | edited | CookiePatriot | CC BY-SA 4.0 | added 871 characters in body |
| Feb 3, 2021 at 12:30 | comment | added | Kamil Maciorowski | Does "but not both" mean a line that contains both should not count at all? Or should it add 1 to the count (as opposed to adding 2)? | |
| Feb 3, 2021 at 12:28 | comment | added | terdon♦ | Please edit your question and i) add an example input file and ii) show the output you expect. Clarify if we should count pan as an occurrence of an or not. Also clarify if you want to count the lines or the number of times each word appears. | |
| Feb 3, 2021 at 12:27 | review | First posts | |||
| Feb 3, 2021 at 12:31 | |||||
| Feb 3, 2021 at 12:27 | history | asked | CookiePatriot | CC BY-SA 4.0 |