Re: [Ilugc] Printing longest value

2014-10-08 Thread Noorul Islam K M
Balasubramaniam Natarajan writes: > Okay found out what to do, however not sure if there are some more > efficient method. > > while read line > do > domain=`echo $line | cut -d" " -f1` > echo $domain >> FirstColumn.txt > done < input.txt > > cat FirstColumn.txt | sort -u > unique.txt > m

Re: [Ilugc] Printing longest value

2014-10-08 Thread Balasubramaniam Natarajan
Okay found out what to do, however not sure if there are some more efficient method. while read line do domain=`echo $line | cut -d" " -f1` echo $domain >> FirstColumn.txt done < input.txt cat FirstColumn.txt | sort -u > unique.txt mv unique.txt FirstColumn.txt while read line do gre

Re: [Ilugc] Printing longest value

2014-10-08 Thread Balasubramaniam Natarajan
Oops sorry the input file looks like this. Bala -> 54; Bala -> 57 Bala -> 56; Bala -> 60 Name -> 64 Name -> 67 Name -> 67 Name -> 70 Super -> 78 First -> 60 First -> 29 On Thu, Oct 9, 2014 at 8:44 AM, Balasubramaniam Natarajan < bala150...@gmail.com> wrote: > Hi > > I have a question of how to p

[Ilugc] Printing longest value

2014-10-08 Thread Balasubramaniam Natarajan
Hi I have a question of how to print the longest line in bash scripting ? Most appropriate would be to search for longest dictionary value. *Input file contains* Bala -> 54; 56; 57 Bala -> 54; 57 Bala -> 56; 57 Bala -> 54; 56; 57;60 Name -> 64; 66; 67 Name -> 64; 67 Name -> 66; 67 Name -> 64; 66;