Re: matrix uniq

2003-03-15 Thread Youichi Mano
Thank you. You mean -w option? I want to uniq by any column,any data. For example, if 2nd column uniq is operated, 1 a BBB 100 bbb CC 100 cc the output will be 10000 a BBB 100

matrix uniq

2003-03-15 Thread Youichi Mano
a 91 2 dog 62 3 apple 89 - the output will be - 1 eagle 197 2 camera 91 3 apple 89 - Such a editing is easy in perl script but I cannot easily do that in command line. Is there any idea? -- Youichi Mano <[EMAIL PROTECTE

Re: about matrix text editing

2003-03-09 Thread Youichi Mano
dear Alan Shutko > awk -F'\t' '($3 == 111)' < 1.txt This is the shortest for now. I am not good at awk than perl but I'll usually use this. -- Youichi Mano <[EMAIL PROTECTED]> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of &

Re: about matrix text editing

2003-03-09 Thread Youichi Mano
dear Joey Hess, Thank you. > > perl -ne 'print if (split)[2]==111' > The default character of delimiter seems to be space, so this does not work well. Instead, I write perl -ne 'print if (split(/\t/))[2]==111' Then, it worked well. regards, -- Y

Re: about matrix text editing

2003-03-09 Thread Youichi Mano
dear Colin Watson. > > Sure you can. Use perl's -e option. > > perl -nle 'my @cols = split /\t/; print if $cols[2] eq "111"' Oh, you are one liner. This sentence is a little long but I am used to perl so it is relatively easy. -- Youichi Mano <

about matrix text editing

2003-03-09 Thread Youichi Mano
-P "^.+?\t.+?\t111\n" 1.txt is confused and very very slow and not smart. I wonder if I could use "grep" together "cut" command. Is there any idea? -- Youichi Mano <[EMAIL PROTECTED]> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]