uniq Questions
5
Solved
I have the following file:
2
1
4
3
2
1
I want the output like this (unique lines that don't have any duplicates and preserve order):
4
3
I tried sort file.txt | uniq -u it works, but output is so...
4
Solved
I have an input file with foillowing data:
line1
line2
line3
begin
line5
line6
line7
end
line9
line1
line3
I am trying to find all the duplicate lines , I tried
sort filename | uniq -c
but ...
9
Solved
I have a .csv file like this:
[email protected],2009-11-27 01:05:47.893000000,domain.example,127.0.0.1
[email protected],2009-11-27 00:58:29.793000000,domain2.example,255.255.255.0
[email...
13
How can I find the unique lines and remove all duplicates from a file?
My input file is
1
1
2
3
5
5
7
7
I would like the result to be:
2
3
sort file | uniq will not do the job. Will show all...
2
Solved
I have a text file (list.txt) containing single and multi-word English phrases. My goal is to do a word count for each word and write the results to a CSV file.
I have figured out the command to w...
5
Solved
I'd like the output of the uniq command to be comma separated, so that instead of:
30 hello
31 world
36 hey_there
142 i_am_bigest
I'll get:
30,hello
31,world
36,hey_there
142,i_am_biggest
...
Alodi asked 10/6, 2013 at 6:6
5
Solved
I'm a beginner in JavaScript and an even bigger beginner in ReactJS. Most of the following I've taken from tutorials and am trying to adapt it. So the codes displays all the values from the "tag" (...
Dott asked 13/3, 2016 at 21:36
4
Solved
I have a two sentences containing duplicate words, for example, the input data in file my_text.txt:
The Unix and Linux operating system.
The Unix and Linux system was to create an environment
that...
5
Solved
I need script that sorts a text file and remove the duplicates.
Most, if not all, of the examples out there use the sort file1 | uniq > file2 approach.
In the man sort though, there is an -u opt...
6
Solved
I would like to extend the Array class with a uniq_elements method which returns those elements with multiplicity of one. I also would like to use closures to my new method as with uniq. For exampl...
7
Solved
I use uniq -c some text file.
Its output like this:
123(space)first word(tab)other things
2(space)second word(tab)other things
....
So I need extract total number(like 123 and 2 above), but I ...
1
Solved
Reference file: http://snap.stanford.edu/data/wiki-Vote.txt.gz
(It is a tape archive that contains a file called Wiki-Vote.txt)
The first few lines in the file that contains the following, head -...
Thetes asked 13/1, 2020 at 13:47
1
Solved
use List::MoreUtils 'uniq';
print join ", ", sort uniq ("b", "a", "a");
results in Argument "a" isn't numeric in sort at ...
print join ", ", uniq sort ("b", "a", "a");
works as expected.
pri...
3
I am trying to find unique and duplicate data in a list of data with two columns. I really just want to compare the data in column 1.
The data might look like this (separated by a tab):
What are...
4
Solved
I need to get the unique URLs from a web log and then sort them. I was thinking of using grep, uniq, sort command and output this to another file
I executed this command:
cat access.log | awk '{p...
8
Solved
I have a utility script in Python:
#!/usr/bin/env python
import sys
unique_lines = []
duplicate_lines = []
for line in sys.stdin:
if line in unique_lines:
duplicate_lines.append(line)
els...
3
Solved
my question is pretty much like this one but with one difference; i want the output the line that has highest score on the 3rd tab. my data is like:
1.gui Qxx 16
2.gui Qxy 23
3.guT QWS 11
and i ...
2
Solved
1
Solved
I have a very large data file (255G; 3,192,563,934 lines). Unfortunately I only have 204G of free space on the device (and no other devices I can use). I did a random sample and found that in a giv...
Kokaras asked 27/7, 2017 at 17:30
2
I'm trying to use the following command on a text file:
$ sort <m.txt | uniq -c | sort -nr >m.dict
However I get the following error message:
sort: string comparison failed: Invalid or i...
5
Solved
I'm just starting with Ruby and I personally find the following to be a violation of the "principle of least surprise". And that is, quoting from the documentation, that uniq! "removes duplicate el...
3
Solved
I have a large file (50 GB) and I could like to count the number of occurrences of different lines in it. Normally I'd use
sort bigfile | uniq -c
but the file is large enough that sorting takes ...
Ploughshare asked 2/9, 2015 at 22:22
4
Solved
I want to calculate the frequency of the words from a file, where the words are one by line. The file is really big, so this might be the problem (it counts 300k lines in this example).
I do this ...
2
I have a file that contains a number followed by a file path on each line for a large amount of files. So it looks like this:
7653 /home/usr123/file123456
But the problem with this is there is ...
Bezonian asked 21/4, 2015 at 0:11
5
Solved
I have an array like this:
[1, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7]
I want to know if there's a method to get this:
[[1, 2, 3, 4, 5, 6, 7], [3, 4, 6], [6]]
I know there is Array.uniq but this remove...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.