Skip to content
Snippets Groups Projects
Commit 5c0582c0 authored by alexis.dereeper_ird.fr's avatar alexis.dereeper_ird.fr
Browse files

Update bash-extracting_from_files.md

parent bed7dcc8
No related branches found
No related tags found
No related merge requests found
Pipeline #39770 passed
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment