Skip to content

Commit

Permalink
Polish after seeing HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
Gammerdinger authored Apr 15, 2024
1 parent 2ba09b1 commit 6ab1e73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Finding_and_summarizing_colossal_files/lessons/AWK_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,18 +310,18 @@ It works! We can see that "moose,bison" is the most commonly observed group of a

<details>
<summary><i>Click here for the answer</i></summary>
<pre>awk ' { counter[$5] += 1 } END { for (animalgroup in counter){ print animalgroup, counter[animalgroup] } }' animal_observations_edited.txt</pre><br><br>
<code>couger,grizzlybear,elk</code> is the most commonly observed group!
<pre>awk ' { counter[$5] += 1 } END { for (animalgroup in counter){ print animalgroup, counter[animalgroup] } }' animal_observations_edited.txt</pre><br>
<code>couger,grizzlybear,elk</code> is the most commonly observed group!<br>
</details>


2. Our code also counts the number of times our header text (Yosemite or Glacier) is repeated. How can you modify the code so that this is ignored?

<details>
<summary><i>Click here for the answer</i></summary>
<ul><li><code>awk 'NR>1 { counter[$2] += 1 } END { for (animalgroup in counter){ print animalgroup, counter[animalgroup] } }' animal_observations_edited.txt</code></li>
<ul><li><pre>awk 'NR>1 { counter[$2] += 1 } END { for (animalgroup in counter){ print animalgroup, counter[animalgroup] } }' animal_observations_edited.txt</pre></li>
Or:
<li><code>awk 'NR>1 { counter[$5] += 1 } END { for (animalgroup in counter){ print animalgroup, counter[animalgroup] } }' animal_observations_edited.txt</code></li></ul>
<li><pre>awk 'NR>1 { counter[$5] += 1 } END { for (animalgroup in counter){ print animalgroup, counter[animalgroup] } }' animal_observations_edited.txt</pre></li></ul>
</details>

****
Expand Down

0 comments on commit 6ab1e73

Please sign in to comment.