Data wrangling

- Delete all non-printing characters
This commit is contained in:
bonnie 2020-07-19 21:13:37 +08:00
parent 0df09b76c3
commit 6c083c518e

View File

@ -2417,6 +2417,11 @@ username=`echo -n "bashoneliner"`
tee <fileA fileB fileC fileD >/dev/null tee <fileA fileB fileC fileD >/dev/null
``` ```
##### Delete all non-printing characters
```bash
tr -dc '[:print:]' < filename
```
##### Remove newline / nextline ##### Remove newline / nextline
```bash ```bash
tr --delete '\n' <input.txt >output.txt tr --delete '\n' <input.txt >output.txt
@ -2429,6 +2434,7 @@ tr '\n' ' ' <filename
##### To uppercase/lowercase ##### To uppercase/lowercase
```bash ```bash
tr /a-z/ /A-Z/ tr /a-z/ /A-Z/
``` ```
##### Translate a range of characters (e.g. substitute a-z into a) ##### Translate a range of characters (e.g. substitute a-z into a)
```bash ```bash