Questions tagged [uniq]

uniq is a Unix/POSIX/Linux utility to remove or filter duplicate lines from a sorted file. It is also the name of a method to remove duplicates from an array in Ruby.

uniq is a Unix/POSIX/Linux utility to remove or filter duplicate lines from a sorted file. It is typically applied to the output of sort.

In Ruby , uniq is a method of the Array class to remove duplicates from an array. uniq creates a new array whereas uniq! modifies the array in place.

For questions about unique identifiers, keys, names, etc., see or more specific tags such as , , , , etc.

Documentation

454 questions
-1
votes
1 answer

Display duplicate lines in two columns of three

I have a file with 3 columns, separated by commas, and I want to show the duplicate lines in two columns of three columns. This is an…
-1
votes
2 answers

migration to add index when column is already exists in db rails?

how to add index when column is already exists in my db? when i create migration like this : class AddIndexToUsers < ActiveRecord::Migration def change remove_column :users, :id_number if index_exists?(:id_number) add_column :users,…
3lviend
  • 243
  • 5
  • 13
-1
votes
2 answers

ruby remove duplicates from multidimensional array

Trying to create every permutation of a set of names and place them into a multi-dimensional array as pairs and then remove any duplicates. The problem I am having is iterating over the array, comparing the two values and deleting that array if…
3therk1ll
  • 2,056
  • 4
  • 35
  • 64
-1
votes
1 answer

How to get the count of duplicate strings in a set using grep, uniq and awk in unix?

I have a very large set of strings, one on every line of a file. Many strings occur more than one times in the file at different locations. I want a frequency count of the strings using unix commands like awk, grep, uniq and so on. I tried few…
London guy
  • 27,522
  • 44
  • 121
  • 179
-1
votes
1 answer

Wrap text in file on ubuntu

I have 2 text files $ cat com.txt user1@myskype.com user3@myskype.net user5@myskype.net user4@myskype.net user2@myskype.net $ cat net.txt user1@myskype.net user3@myskype.net user5@myskype.net user2@myskype.net user4@myskype.net now i would like to…
Kevin Nguyen
  • 1,759
  • 2
  • 16
  • 14
-2
votes
1 answer

How remove equal rows having n columns in Linux

I have a file (df.txt) with 3045 rows and 900.000 columns, but 145 repeated rows, thus: 1234 1111122233330000000000003333311122222............................ 1235678 00000000000000000000000111111122222............................ 4567 …
Johanna Ramirez
  • 161
  • 1
  • 9
-2
votes
2 answers

javascript - pick unique items from first array

Suppose I have two arrays of objects const array1 = [{ listName: 'My top 5 Sci-Fi Movies', listCreator: 'Anon', listItem: 'The Fifth Element' }, { listName: 'My top 5 Sci-Fi Movies', listCreator:…
Kamal
  • 383
  • 1
  • 6
  • 16
-2
votes
1 answer

How to display number of times a word repeated after a common pattern

I have a file which has N number of line For example This/is/workshop/1 This/is/workshop/2 This/is/workshop/3 This/is/workshop/4 This/is/workshop/5 How to get the below result using uniq command: This/is/workshop/ =5
varun kumar
  • 133
  • 2
  • 8
-2
votes
1 answer

Find duplicate lines

considering this file: cat 1.txt 1 Red 1 Red 2 Red 2 Green 2 Green 4 Blu 5 Black 5 Black 5 Yellow 5 Pink 11 Brown 15 Brown 16 White and this command cat file.txt | sort | uniq -c how could I do the same thing with python?
Pydavide
  • 59
  • 4
-2
votes
1 answer

segmentation violation when indirecting through unallocated pointers

I tried something but Resus mainly not know how to read the file line by line to compare lines between them, I get the error segmentation fault ( core dumped ). This is my function for uniq -u command void uniq_u() { // …
-2
votes
2 answers

how to insert uniqid() in javascript

I am trying to bind a uniqid() to an onclick event in a string: $UniquepreID = uniqid(); $selectbutton = ''; The $UniquepreID…
nuet
  • 219
  • 4
  • 12
-2
votes
2 answers

How to take only latest uniq record based on any column

I am writing a script in perl. but got stuck in one part. Below is the sample of my csv…
Ankur
  • 197
  • 2
  • 17
-2
votes
1 answer

Sort,Unique and displaying max count

In the table below, Remove duplicates and for some point of time say 12:06 only maximum count value should be displayed 3/12/2013 12:00 639 Count 3/12/2013 12:06 693 Count 3/12/2013 12:12 636 Count 3/12/2013 12:18 649 Count 3/12/2013 12:24 658…
user2162716
  • 5
  • 1
  • 3
-2
votes
5 answers

Bash-Script (separating string)

I have an exercise in which I have to get a string from the user read str and to print the number of times which the last character of this string is being repeated. For example, the string is: ab2aa2b122 and the output will be : 4 because 2 is…
user1923376
  • 51
  • 1
  • 1
  • 4
-3
votes
1 answer

sort and uniquize a tab separated file for two columns

i have a very large tab separated file, a part of which looks like this: 33 x 171 297 126 4 x 171 300 129 2 x 171 303 132 11 y 163 289 126 5 y 163 290 127 3 y 163 291 128 2 y 163 292 129 2 y 170 289 119 2 z 166 307…
kaur
  • 9
  • 1
1 2 3
30
31