Sponsored Content
Full Discussion: Grep unique 1st column
Top Forums UNIX for Dummies Questions & Answers Grep unique 1st column Post 302897566 by spacebar on Monday 14th of April 2014 08:06:42 PM
Old 04-14-2014
Do a "man grep" and look at the option:
-m NUM, --max-count=NUM
and see if using that with a 1 is what you want.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep for unique value

If i want to grep for a value in a file but display only unique value then which option can i use. ex: Values in the file IP <1.2.3.4> value <2> IP <1.2.3.4> value <2> IP <1.2.3.4> value <3> IP <1.2.3.5> value <1> i should get only the unique value (3 Replies)
Discussion started by: vls1210
3 Replies

2. Shell Programming and Scripting

print unique values of a column and sum up the corresponding values in next column

Hi All, I have a file which is having 3 columns as (string string integer) a b 1 x y 2 p k 5 y y 4 ..... ..... Question: I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Discussion started by: amigarus
6 Replies

3. UNIX for Dummies Questions & Answers

Grep Unique

Hello, I have a file with a list of car makes and specific information for each make. An example is: @Audi:Warranty @Audi:Pricing @Audi:Colors @Acura:Warranty @Acura:Pricing @Acura:Colors and so on through a bunch of makes. I need to make a list in a selection box of just one name of... (4 Replies)
Discussion started by: macbb1117
4 Replies

4. Shell Programming and Scripting

Grep/Awk on 1st 2 Letters in 2nd Column of File

Hi everyone. I need to change a script (ksh) so that it will grep on the 1st 2 letters in the second column of a 5 column file such as this one: 192.168.1.1 CAXY0_123 10ABFL000001 # Comment 192.168.1.2 CAYZ0_123 10ABTX000002 # Comment 192.168.2.1 FLXY0_123 11ABCA000001 ... (4 Replies)
Discussion started by: TheNovice
4 Replies

5. Shell Programming and Scripting

Sorting unique by column

I am trying to sort, do uniq by 1st column and report this 4 columns tab delimiter table , eg chr10:112174128 rs2255141 2E-10 Cholesterol, total chr10:112174128 rs2255141 7E-16 LDL chr10:17218291 rs10904908 3E-11 HDL Cholesterol chr10:17218291 rs970548 8E-9 TG... (4 Replies)
Discussion started by: fat
4 Replies

6. Linux

Print the 1st column and the value in 2nd or 3rd column if that is different from the values in 1st

I have file that looks like this, DIP-17571N|refseq:NP_651151 DIP-17460N|refseq:NP_511165|uniprotkb:P45890 DIP-17571N|refseq:NP_651151 DIP-19241N|refseq:NP_524261 DIP-19241N|refseq:NP_524261 DIP-17151N|refseq:NP_524316|uniprotkb:O16797 DIP-19588N|refseq:NP_731165 ... (2 Replies)
Discussion started by: Syeda Sumayya
2 Replies

7. Shell Programming and Scripting

Count occurrence of column one unique value having unique second column value

Hello Team, I need your help on the following: My input file a.txt is as below: 3330690|373846|108471 3330690|373846|108471 0640829|459725|100001 0640829|459725|100001 3330690|373847|108471 Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Discussion started by: angshuman
4 Replies

8. UNIX for Beginners Questions & Answers

Find unique values but only in column 1

Hi All, Does anyone have any suggestions/examples of how i could show only lines where the first field is not duplicated. If the first field is listed more than once it shouldnt be shown even if the other columns make it unique. Example file : 876,RIBDA,EC2 876,RIBDH,EX7 877,RIBDF,E28... (4 Replies)
Discussion started by: mutley2202
4 Replies

9. UNIX for Beginners Questions & Answers

Count unique column

Hello, I am trying to count unique rows in my file based on 4 columns (2-5) and to output its frequency in a sixth column. My file is tab delimited My input file looks like this: Colum1 Colum2 Colum3 Colum4 Coulmn5 1.1 100 100 a b 1.1 100 100 a c 1.2 200 205 a d 1.3 300 301 a y 1.3 300... (6 Replies)
Discussion started by: nans
6 Replies
GRUB-FSTEST(3)						     Library Functions Manual						    GRUB-FSTEST(3)

NAME
grub-fstest -- Debug tool for GRUB's filesystem driver. SYNOPSIS
grub-fstest [-c | --diskcount=NUM] [-C | --crypto] [-d | --debug=STRING] [-K | --zfs-key=FILE|prompt] [-n | --length=NUM] [-r | --root=DEVICE_NAME] [-s | --skip=NUM] [-u | --uncompress] [-v | --verbose] IMAGE_PATH <blocklist FILE | cat FILE | cmp FILE LOCAL | cp FILE LOCAL | crc FILE | hex FILE | ls PATH | xnu_uuid DEVICE> DESCRIPTION
grub-fstest is a tool for testing GRUB's filesystem drivers. You should not normally need to run this program. OPTIONS
--diskcount=NUM Specify the number of input files. --crypto Mount cryptographic devices. --debug=STRING Set debug environment variable. --zfs-key=FILE|prompt Load ZFS cryptographic key. --length=NUM Handle NUM bytes in output file. --root=DEVICE_NAME Set root device. --skip=NUM Skip NUM bytes from output file. --uncompress Uncompress data. --verbose Print verbose messages. COMMANDS
blocklist FILE Display block list of FILE. cat FILE Display FILE on standard output. cmp FILE LOCAL Compare FILE with local file LOCAL. cp FILE LOCAL Copy FILE to local file LOCAL. crc FILE Display the CRC-32 checksum of FILE. hex FILE Display contents of FILE in hexidecimal. ls PATH List files at PATH. xnu_uuid DEVICE Display the XNU UUID of DEVICE. SEE ALSO
info grub Wed Feb 26 2014 GRUB-FSTEST(3)
All times are GMT -4. The time now is 05:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy