Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Getting unique list of numbers using grep Post 302343326 by tinku on Wednesday 12th of August 2009 07:19:34 AM
Old 08-12-2009
The last option is PERFECT. It gives exactly what i needed.

Tons of thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to check the unique numbers in huge data

Friends, I have to write a shell script,the description is---- i Have to check the uniqueness of the numbers in a file. A file is containing 200thousand tickets and a ticket have 15 numbers in asecending order.And there is a strip that is having 6 tickets that means 90 numbers.I... (7 Replies)
Discussion started by: namishtiwari
7 Replies

2. UNIX for Dummies Questions & Answers

To get unique numbers from two files

here i have two files: file 1 1 2 3 4 5 5 6 7 8 9 file 2 4 5 6 6 8 8 (6 Replies)
Discussion started by: i.scientist
6 Replies

3. 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

4. Shell Programming and Scripting

How to generate 10.000 unique numbers?

hello, does anybody can give me a hint on how to generate a lot of numbers which are not identically via scripting etc? (7 Replies)
Discussion started by: xrays
7 Replies

5. 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

6. UNIX for Dummies Questions & Answers

grep specific number from a list of numbers

Hello. I have 9060 files labelled File1 to File9060. They are in numerical order. When I grep a file eg. File90 it will show me all files that contain the pattern "File90", eg File901 or File9001. I can only get specific files for File1000 or higher. How can I resolve this problem? Is there a... (5 Replies)
Discussion started by: godzilla07
5 Replies

7. Shell Programming and Scripting

Replace string ids with unique numbers

Hello, I have a file with a 1000 ids in the form of strings. I want to replace each id with a unique numbers in the whole file. each id is repeating in all the columns. I know I can use sed command but there are many ids in file which are need to be converted example of input file B752... (4 Replies)
Discussion started by: ryan9011
4 Replies

8. Shell Programming and Scripting

unique random numbers awk

Hi, I have a small piece of awk code (see below) that generates random numbers. gawk -F"," 'BEGIN { srand(); for (i = 1; i <= 30; i++) printf("%s AM329_%04d\n",$0,int(36 * rand())+1) }' OFS=, AM329_hole_names.csv The code works fine and generates alphanumeric numbers like AM329_0001,... (2 Replies)
Discussion started by: theflamingmoe
2 Replies

9. Shell Programming and Scripting

Unique entries based on a range of numbers.

Hi, I have a matrix like this: Algorithm predicted_gene start_point end_point A x 65 85 B x 70 80 C x 75 85 D x 10 20 B y 125 130 C y 120 140 D y 200 210 Here there are four tab-separated columns. The first column is the used algorithm for prediction, and there are 4 of them A-D.... (8 Replies)
Discussion started by: flyfisherman
8 Replies

10. Shell Programming and Scripting

Printing unique numbers from each file

I have some files named file1, file2, fille3......etc. These files are in a folder f1. The content of files are shown below. I would like to count the unique pairs of third column in each file. some files have no data. It should be printed as zero. Your help would be appreciated. file1 ARG... (1 Reply)
Discussion started by: samra
1 Replies
LSDIFF(1)							     Man pages								 LSDIFF(1)

NAME
lsdiff - show which files are modified by a patch SYNOPSIS
lsdiff [[-n] | [--line-number]] [[-p n] | [--strip-match=n]] [--strip=n] [--addprefix=PREFIX] [[-s] | [--status]] [[-E] | [--empty-files-as-removed]] [[-i PATTERN] | [--include=PATTERN]] [[-x PATTERN] | [--exclude=PATTERN]] [[-z] | [--decompress]] [[-# RANGE] | [--hunks=RANGE]] [--lines=RANGE] [--files=RANGE] [[-H] | [--with-filename]] [[-h] | [--no-filename]] [[-v] | [--verbose]...] [file...] lsdiff {[--help] | [--version] | [--filter ...] | [--grep ...]} DESCRIPTION
List the files modified by a patch. You can use both unified and context format diffs with this program. OPTIONS
-n, --line-number Display the line number that each patch begins at. If verbose output is requested (using -nv), each hunk of each patch is listed as well. For each file that is modified, a line is generated containing the line number of the beginning of the patch, followed by a Tab character, followed by the name of the file that is modified. If -v is given once, following each of these lines will be one line for each hunk, consisting of a Tab character, the line number that the hunk begins at, another Tab character, the string "Hunk #", and the hunk number (starting at 1). If the -v is given twice in conjunction with -n (i.e. -nvv), the format is slightly different: hunk-level descriptive text is shown after each hunk number, and the --number-files option is enabled. --number-files File numbers are listed, beginning at 1, before each filename. -# RANGE, --hunks=RANGE Only list hunks within the specified RANGE. Hunks are numbered from 1, and the range is a comma-separated list of numbers or "first-last" spans; either the first or the last in the span may be omitted to indicate no limit in that direction. --lines=RANGE Only list hunks that contain lines from the original file that lie within the specified RANGE. Lines are numbered from 1, and the range is a comma-separated list of numbers or "first-last" spans; either the first or the last in the span may be omitted to indicate no limit in that direction. --files=RANGE Only list files indicated by the specified RANGE. Files are numbered from 1 in the order they appear in the patch input, and the range is a comma-separated list of numbers or "first-last" spans; either the first or the last in the span may be omitted to indicate no limit in that direction. -p n, --strip-match=n When matching, ignore the first n components of the pathname. --strip=n Remove the first n components of the pathname before displaying it. --addprefix=PREFIX Prefix the pathname with PREFIX before displaying it. -s, --status Show file additions, modifications and removals. A file addition is indicated by a "+", a removal by a "-", and a modification by a "!". -E, --empty-files-as-removed Treat empty files as absent for the purpose of displaying file additions, modifications and removals. -i PATTERN, --include=PATTERN Include only files matching PATTERN. -x PATTERN, --exclude=PATTERN Exclude files matching PATTERN. -z, --decompress Decompress files with extensions .gz and .bz2. -H, --with-filename Print the name of the patch file containing each patch. -h, --no-filename Suppress the name of the patch file containing each patch. -v, --verbose Verbose output. --help Display a short usage message. --version Display the version number of lsdiff. --filter Behave like filterdiff(1) instead. --grep Behave like grepdiff(1) instead. SEE ALSO
filterdiff(1), grepdiff(1) EXAMPLES
To sort the order of touched files in a patch, you can use: lsdiff patch | sort -u | xargs -rn1 filterdiff patch -i To show only added files in a patch: lsdiff -s patch | grep '^+' | cut -c2- | xargs -rn1 filterdiff patch -i To show the headers of all file hunks: lsdiff -n patch | (while read n file do sed -ne "$n,$(($n+1))p" patch done) AUTHOR
Tim Waugh <twaugh@redhat.com> Package maintainer patchutils 23 Jan 2009 LSDIFF(1)
All times are GMT -4. The time now is 09:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy