separate file by line length

hi all,

i'm new in unix....

i have question, sorry if it's missplace or too silly

let say i have a file name testfile.log that contains data

000001
000002
000003
aaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbb
cccccccccccccc
dddddddddddddddddd
000004

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

regards,

steven

Something like this:

$
$ # 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
$
$

tyler_durden

thx help alot

-----Post Update-----

another question

i want to make new file that dont consist particular string for example "bbbb"

i have

aaaaaaa
vbbbbq
abbbbx
cccccc
ddddd

i want to make new file that consist
aaaaaaa
cccccc
ddddd

thx before

you questions are very simple to do. what have you got ? someone has already shown you how to use awk. Look up the awk documentation and see how you can do the second task.