Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help required on Printing of Numbers, which are missing in the range Post 302357221 by krao on Tuesday 29th of September 2009 06:18:28 AM
Old 09-29-2009
Help required on Printing of Numbers, which are missing in the range

Hi Experts,

Need help on printing of numbers, which are missing in the range.

Pls find the details below

Input

1000000002
1000000007
1234007940
1234007946

Output

1000000003
1000000004
1000000005
1000000006
1234007941
1234007942
1234007943
1234007944
1234007945

I have tried the below command, but its not working.

awk '{ l=substr($1,1,5); t= substr($1,6,10); NR=NR+1; k = substr($1,6,10) ; m=substr($1,1,5); if ( t == k) { p = m-l; if(p>1) for (i=1; i<(p-1); i++){z= l+i; print t z }}}' input_file

Pls help me
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fill in missing numbers in range

I need to edit a list of numbers on the following form: 1 1.0 2 1.4 5 2.1 7 1.9 I want: 1 1.0 2 1.4 3 0.0 4 0.0 5 2.1 6 0.0 7 1.9 (i want to add the missing number in column 1 together with 0.0 in column 2). I guess it is rather trivial but i didn't even manage to read column... (5 Replies)
Discussion started by: bistru
5 Replies

2. Shell Programming and Scripting

read numbers from file and output which numbers belongs to which range

Howdy experts, We have some ranges of number which belongs to particual group as below. GroupNo StartRange EndRange Group0125 935300 935399 Group2006 935400 935476 937430 937459 Group0324 935477 935549 ... (6 Replies)
Discussion started by: thepurple
6 Replies

3. UNIX for Dummies Questions & Answers

List-to-Range of Numbers

Hello, I have two columns with data that look like this: Col1 Col2 ------ ----- a 1 a 2 a 3 a 4 a 7 a 8 a 9 a 10 a 11 b 6 b 7 b 8 b 9 b 14 (5 Replies)
Discussion started by: Gussifinknottle
5 Replies

4. UNIX for Dummies Questions & Answers

Frequency of a range of numbers

Hello, I have a column where there are values from 1 to 150. I want to get the frequency of values in the following ranges: 1-5 6-10 11-15 .... .... .... 146-150 How can I do this in a for loop? Thanks, Guss (1 Reply)
Discussion started by: Gussifinknottle
1 Replies

5. UNIX for Dummies Questions & Answers

How to count how many numbers in a certain range?

Hi I have a data file with two columns which looks like: 1 42 2 40 3 55 4 50 5 38 6 49 7 33 8 46 9 39 10 33 11 33 12 26 13 46 14 44 15 55 16 54 17 30 18 32 (7 Replies)
Discussion started by: marhuu
7 Replies

6. Shell Programming and Scripting

Match on a range of numbers

Hi, I'm trying to match a filename that could be called anything from vout001 to vout252 and was trying to do a small test but I'm not getting the result I thought I would.. Can some one tell me what I'm doing wrong? *****@********>echo $mynumber ... (4 Replies)
Discussion started by: Jazmania
4 Replies

7. Shell Programming and Scripting

ERROR: Required Parameters Missing

i have modified a korn shell script to include a parameter and i coded the parameter as pSec=$1 pLoopCnt=$2 wheni run the script it gives me an error $ ksh sfs_pcard_load_file.ksh 30 3 ERROR: Required Parameters Missing. USAGE: sfs_pcard_load_file.ksh please help i think i might... (4 Replies)
Discussion started by: wtolentino
4 Replies

8. Shell Programming and Scripting

sed one Liner inverse range match-help required

cat test.txt a c d e g (2 Replies)
Discussion started by: TomG
2 Replies

9. Red Hat

Missing the MySQL extension which is required by WordPress.

hi i started in the apache userdirectory and virtual host now iwant installtion wordpress in home one of the useres But this error is Your PHP installation appears to be missing the MySQL extension which is required by WordPress. And the configuration files and other items I was enter... (0 Replies)
Discussion started by: mnnn
0 Replies

10. Shell Programming and Scripting

Check/print missing number in a consecutive range and remove duplicate numbers

Hi, In an ideal scenario, I will have a listing of db transaction log that gets copied to a DR site and if I have them all, they will be numbered consecutively like below. 1_79811_01234567.arc 1_79812_01234567.arc 1_79813_01234567.arc 1_79814_01234567.arc 1_79815_01234567.arc... (3 Replies)
Discussion started by: newbie_01
3 Replies
postreverse(1)							   User Commands						    postreverse(1)

NAME
postreverse - reverse the page order in a PostScript file SYNOPSIS
postreverse [-o list] [-r] [file] /usr/lib/lp/postscript/postreverse DESCRIPTION
The postreverse filter reverses the page order in files that conform to Adobe's Version 1.0 or Version 2.0 file structuring conventions, and writes the results on the standard output. Only one input file is allowed and if no file is specified, the standard input is read. The postreverse filter can handle a limited class of files that violate page independence, provided all global definitions are bracketed by %%BeginGlobal and %%EndGlobal comments. In addition, files that mark the end of each page with %%EndPage: label ordinal comments will also reverse properly, provided the prologue and trailer sections can be located. If postreverse fails to find an %%EndProlog or %%EndSetup com- ment, the entire file is copied, unmodified, to the standard output. Because global definitions are extracted from individual pages and put in the prologue, the output file can be minimally conforming, even if the input file was not. OPTIONS
-o list Select pages whose numbers are given in the comma-separated list. The list contains single numbers N and ranges N1 - N2. A missing N1 means the lowest numbered page, a missing N2 means the highest. The page range is an expression of logical pages rather than physical sheets of paper. For example, if you are printing two logical pages to a sheet, and you specified a range of 4, then two sheets of paper would print, containing four page layouts. If you specified a page range of 3-4, when requesting two logical pages to a sheet; then only page 3 and page 4 layouts would print, and they would appear on one physical sheet of paper. -r Do not reverse the pages in file. EXAMPLES
Example 1: Examples of postreverse. o select pages 1 to 100 from file and reverse the pages: example% postreverse -o1-100 file To print four logical pages on each physical page and reverse all the pages: example% postprint -n4 file | postreverse To produce a minimally conforming file from output generated by dpost without reversing the pages: example% dpost file | postreverse -r EXIT STATUS
The following exit values are returned: 0 Successful completion. non-zero An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpsf | +-----------------------------+-----------------------------+ SEE ALSO
download(1), dpost(1), postdaisy(1), postdmd(1), postio(1), postmd(1), postprint(1), posttek(1), attributes(5) NOTES
No attempt has been made to deal with redefinitions of global variables or procedures. If standard input is used, the input file will be read three times before being reversed. SunOS 5.10 9 Sep 1996 postreverse(1)
All times are GMT -4. The time now is 04:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy