10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
When I use the below awk to count the unique lines in $4 for the input it seems to work. The answer is 3 because $4 is only unique 3 times in all the entries. However, when I use the same on actual data I get 56,536 and I know the answer should be 56,548. My question is there a better way to... (8 Replies)
Discussion started by: cmccabe
8 Replies
2. UNIX for Dummies Questions & Answers
I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies
3. Shell Programming and Scripting
Hello to all, happy new year 2013!
May somebody could help me, is about a very similar problem to the problem I've posted here where the member rdrtx1 and bipinajith helped me a lot.
https://www.unix.com/shell-programming-scripting/211147-map-values-blocks-single-line-2.html
It is very... (3 Replies)
Discussion started by: Ophiuchus
3 Replies
4. UNIX for Dummies Questions & Answers
hi
i have used comm -13 <(sort 1.txt) <(sort 2.txt) option to get the unique lines that are present in file 2 but not in file 1. but some how i am getting the entire file 2. i would expect few but not all uncommon lines fro my dat. is there anything wrong with the way i used the command?
my... (1 Reply)
Discussion started by: anurupa777
1 Replies
5. Shell Programming and Scripting
I am having a file with duplicate words how can I eliminate them
ant,bat
bat,cat
cat a.txt | grep -bat | awk '{print $1}'
expecting o/p as ant,bat,cat
How can I display the output as ant,bat,cat in a single line and no duplicates exists. (2 Replies)
Discussion started by: shikshavarma
2 Replies
6. UNIX for Advanced & Expert Users
Hi All,
I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space.
I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies
7. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The uniq command excludes consecutive duplicate lines. It has a -c option to display a count of the number... (1 Reply)
Discussion started by: billydeanmak
1 Replies
8. Shell Programming and Scripting
Hi all! Im wondering if its possible to remove all lines between two lines. Im working with a document like this:
data1
data2
<Remove>
data3
data4
</Remove>
data5
data6
I need it to end up like this if that possible:
data1
data2
data5
data6
There are multiple instances of... (2 Replies)
Discussion started by: Grizzly
2 Replies
9. Shell Programming and Scripting
I have a file, test.txt with approx 12,000 lines. Each line is a single word that looks like a hex address. There are many repeats. Over half of the lines are the same. I want to count how many UNIQUE lines there are.
#>more test.txt
0x123456
0x56AF23
0x99ABC1
0x123456
0x123456
0x99ABC1... (3 Replies)
Discussion started by: ajp7701
3 Replies
10. Shell Programming and Scripting
Hi,
how i can display all the unique number from my random number script below;
#!/usr/bin/perl
use strict;
my @alphanum = ( 'A' .. 'Z', 'a' .. 'z', 0 .. 9);
my $random = join('', map($alphanum,(1..5)));
print "$random\n";
Thank You. (1 Reply)
Discussion started by: malaysoul
1 Replies