Quote:
Originally Posted by venven
...
i want to make new file (newfile.log) that only consist
aaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbb
cccccccccccccc
dddddddddddddddddd
ps: what i want is, i split by line length which is > 6
...
|
Something like this:
Code:
$
$ # display contents of testfile.log
$ cat testfile.log
000001
000002
000003
aaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbb
cccccccccccccc
dddddddddddddddddd
000004
$
$ # pick up only those lines that are more than 6 chars long
$ awk 'length > 6' testfile.log
aaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbb
cccccccccccccc
dddddddddddddddddd
$
$ # pick up only those lines that are more than 6 chars long AND put them in a new file
$ awk 'length > 6' testfile.log > newfile.log
$
$ # verify that the new file has the stuff you want
$ cat newfile.log
aaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbb
cccccccccccccc
dddddddddddddddddd
$
$