08-07-2009
Thanks for the help.
i have missed some information in my previous communication.
The number starts with the pattern "0032" and it is 10 character length. And I will
get multiple numbers on the same lines. Some blank spaces, blank lines will also come in between the data.
A sample file, as follows:
<Sample data>
0032459999 0032458888 0032457777
0032451111 0032452222 0032453333
0032459999 0032458888 0032457777
0032451111 0032452222 0032453333
</Sample data>
And numbers is duplicated all over the file.
Each number is seprated by two spaces.
Sometimes, a large chunk of white space prefixed before the numbers.
But always the length of line is fixed to 151 characters.
Actually I want to create a report and in the report I want to list the number one below another like the below one.
<Sample output>
0032451111
0032452222
0032453333
0032457777
0032458888
0032459999
</Sample output>
Any help on this is appreciated.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
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
LEARN ABOUT CENTOS
lsdiff
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)