diff --git a/docs/pages/bash/bash-extracting_from_files.md b/docs/pages/bash/bash-extracting_from_files.md index dddabbfd61b962d7f74532440ddb67e5b18e8e75..fc50c828f6d64d31076238b49c9c5e5746005d8d 100644 --- a/docs/pages/bash/bash-extracting_from_files.md +++ b/docs/pages/bash/bash-extracting_from_files.md @@ -166,11 +166,6 @@ The `uniq` command can be used to remove the redundancy. But result need to be s sort -n -t ';' -k4 nat2021.csv | tail -n 50 | cut -d";" -f 2 | sort | uniq ``` -!!! question "How many time the name JEAN has been provided in total?" - -??? example "Click to show the solution" - It start to be too complicated for the command you have seen so far, you need to use a command specific to column data `awk` - ## Redirecting an output (>) @@ -206,4 +201,12 @@ You can redirect a result and store it in a file thanks to the `>` redirection: ``` -## Filtering a file (awk) \ No newline at end of file +## Filtering a file (awk) + +!!! question "Using `awk` on tabular file, display the most popular names (given more than 10000 times) between 1980 and 1990" + +??? example "Click to show the solution" + ```bash + awk {'if ($3 >= 1980 && $3 <= 1990 && $4 > 10000)print $1'} nat2021.tsv + ``` +