diff --git a/docs/pages/bash/bash-extracting_from_files.md b/docs/pages/bash/bash-extracting_from_files.md index 84335c61ab783d2be81cb08e8d6ff34be90994d5..820ecaf5ce27658defd7cd9fc3be2be6992990fb 100644 --- a/docs/pages/bash/bash-extracting_from_files.md +++ b/docs/pages/bash/bash-extracting_from_files.md @@ -191,7 +191,20 @@ You can redirect a result and store it in a file thanks to the `>` redirection: ## Replacing patterns (sed) +!!! question "Using the sed command, convert CSV file into a tabular file in a new file called `nat2021.tsv`" +??? example "Click to show the solution" + ```bash + # command + sed "s/;/\t/g" nat2021.csv > nat2021.tsv + ``` +!!! question "In the tabular file, replace the information 1/2 by F/M" +??? example "Click to show the solution" + ```bash + # command + sed -i "s/^1/M/g" nat2021.tsv + sed -i "s/^2/F/g" nat2021.tsv + ``` \ No newline at end of file