mirror of
https://github.com/onceupon/Bash-Oneliner
synced 2024-11-23 05:03:52 +00:00
add awk
This commit is contained in:
parent
a8a00d052d
commit
e7d3e325d2
1 changed files with 13 additions and 0 deletions
13
README.md
13
README.md
|
@ -415,6 +415,19 @@ awk '{while (match($0, /[0-9]+\[0-9]+/)){
|
|||
```bash
|
||||
awk '{printf("%s\t%s\n",NR,$0)}'
|
||||
```
|
||||
#####break combine column data into rows
|
||||
|
||||
e.g.
|
||||
seperate
|
||||
David cat,dog
|
||||
into
|
||||
David cat
|
||||
David dog
|
||||
detail here: http://stackoverflow.com/questions/33408762/bash-turning-single-comma-separated-column-into-multi-line-string
|
||||
```bash
|
||||
awk '{split($2,a,",");for(i in a)print $1"\t"a[i]}' file
|
||||
```
|
||||
|
||||
|
||||
##Xargs
|
||||
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
||||
|
|
Loading…
Reference in a new issue