Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

awk only first six letters

$ cat file1
abc|ABC|123456789|QWERTZ
abc|ABC|1|QWERTZ
abc|ABC|0|QWERTZ
abc|ABC|123456789|QWERTZ

$ awk -F| '$3 > 0 { print substr($3,1,6)}' file1
123456
1
123456
Source by www.unix.com #
 
PREVIOUS NEXT
Tagged: #awk #letters
ADD COMMENT
Topic
Name
6+2 =