May 17, 2005 #1 ogniemi Technical User Nov 7, 2003 1,041 PL and how to test if words / columns in raw are identical? thx.!
May 17, 2005 #2 Mike042 MIS May 17, 2004 456 US Have you looked at the man pages for sort and/or uniq ? I hope that helps. Mike Upvote 0 Downvote
May 17, 2005 Thread starter #3 ogniemi Technical User Nov 7, 2003 1,041 PL Mike , is it really possible to sort words in row using sort? I mean, for example: c b a g and get in the result: a b c g Upvote 0 Downvote
Mike , is it really possible to sort words in row using sort? I mean, for example: c b a g and get in the result: a b c g
May 17, 2005 1 #4 vgersh99 Programmer Jul 27, 2000 2,146 US echo 'c b a g' | tr ' ' '\n' | sort | tr '\n' ' ' vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
echo 'c b a g' | tr ' ' '\n' | sort | tr '\n' ' ' vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
May 18, 2005 Thread starter #5 ogniemi Technical User Nov 7, 2003 1,041 PL vlad, and how to proceed with multiple rows (file with multiple rows)? thx,! Upvote 0 Downvote
May 18, 2005 #6 vgersh99 Programmer Jul 27, 2000 2,146 US Code: #!/bin/ksh inputFile='og.txt' while read line do echo "${line}" | tr ' ' '\n' | sort | tr '\n' ' ' echo '' done < "${inputFile}" vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
Code: #!/bin/ksh inputFile='og.txt' while read line do echo "${line}" | tr ' ' '\n' | sort | tr '\n' ' ' echo '' done < "${inputFile}" vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
May 19, 2005 Thread starter #7 ogniemi Technical User Nov 7, 2003 1,041 PL thx vlad, i though there is some oneliner as well for this operation.... but script is also ok. thx. Upvote 0 Downvote