Sponsored Content
Top Forums UNIX for Dummies Questions & Answers To find missing numbers from a number series Post 302423871 by rakeshbharadwaj on Sunday 23rd of May 2010 02:40:30 AM
Old 05-23-2010
To find missing numbers from a number series

Hi,

My requirement is I have an input file with a continuous series from 10000 to 99999. I have some numbers missing from those series. I want a output file which produces those missing numbers.

Eg: 10002, 99999 are missing from the series then the output file should contain those two numbers.

If possible please let me know if it can be done using one single command.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to generate a series of numbers

Hi All, I have a requirement where in I have an input as follows:- input=1-4,6,8-10,12-15 I need to explode this range into an output file as follows:- 1 2 3 4 6 8 9 10 12 13 14 15 My input may vary like 1,5-9,11-13,15-17....... (3 Replies)
Discussion started by: rony_daniel
3 Replies

2. Shell Programming and Scripting

How to sort out the latest one from a series of numbers?

Hi, I have a directory which contains a number of sub directories. They are named as 1.0.0, 1.0.1, 1.0.2...1.1.0..1.1.1...1.2.0..and so on.. Basically these are the tags created at the time of release. Tags are named as major.minor.buildnumber format for modules. Now I have to search the... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

3. Shell Programming and Scripting

How to code a series of numbers in SH

Hi. How can I write this in a shorter way? for NUMs in 1 2 3 4 5 6 I looked at the"seq" command, but I do not think that is what I want. Can I code for NUMs (1..7) Hey!! Is that it? (8 Replies)
Discussion started by: Ccccc
8 Replies

4. Homework & Coursework Questions

Help with shell script to find sum of first n numbers of Fibonacci series

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Shell script to find sum of first n numbers of Fibonacci series 2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: Kshitija
0 Replies

5. Shell Programming and Scripting

How to get the number series in between?

Hi Guys, Can someone give me a simple script that can extract the numbers in between numbers from start to end. As shown below, it start from 100 to 110 and revealed the numbers in between. INPUT: 100 - 110 DESIRED OUTPUT: 100 101 102 103 104 105 106 107 (6 Replies)
Discussion started by: pinpe
6 Replies

6. Shell Programming and Scripting

How do i find the first number in each line and insert dummy string into the missing columns?

Hi, I have one input file with the following content: MY_inpfile.txt Aname1 Cname1 Cname2 1808 5 Aname2 Cname1 1802 47 Bname1 ? 1819 22 Bname2 Cname1 1784 11 Bname3 1817 9 Zname1 Cname1 1805 59 Zname2 Cname1 Cname2 Cname3 1797 27 Every line in my input file have a 4 digit... (5 Replies)
Discussion started by: Szaffy
5 Replies

7. Shell Programming and Scripting

AWK series of numbers

Hi, I have a dataset say 1 2 3 4 5 5 6 7 6 7 8 9 I was wondering if there is a way to add another column with the following style... 1 2 3 4 xyz_1 5 5 6 7 xyz_2 6 7 8 9 xyz_3 It would be greatly appreciated if I can have an option of specifying what to write instead of xyz,... (8 Replies)
Discussion started by: jacobs.smith
8 Replies

8. Shell Programming and Scripting

Moving decimal point in a series of numbers

Hi, i need to move the decimal point from a file listing some numbers like this : 49899.50 49914.55 49894.48 49939.65 49879.44 49919.57 49934.62 49944.67 49954.72 (1 Reply)
Discussion started by: Board27
1 Replies

9. 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
Math::Fibonacci(3pm)					User Contributed Perl Documentation				      Math::Fibonacci(3pm)

NAME
Math::Fibonacci - Fibonacci numbers. VERSION
$Revision: 1.5 $ SYNOPSIS
use Math::Fibonacci qw(term series decompose); my $term = term ( 42 ); my @series = series ( 42 ); my @sum = decompose ( 65535 ); DESCRIPTION
This module provides a few functions related to Fibonacci numbers. EXPORTS ON REQUEST
term(), series() decompose(), isfibonacci() FUNCTIONS
term($n) Returns the $n-th term of the Fibonacci sequence. The term is computed using the fast algorithm: "F(n) ~ g^n/sqrt(5)", where g is the golden ratio and ~ means "take the nearest integer". series($n) Computes and returns the first $n Fibonacci numbers. decompose($int) Decomposes $int into the sum of Fibonacci numbers. Returns the list of Fibonacci numbers. isfibonacci($int) Returns the sequence number of $int if it is a Fibonacci number or a non-true value if it is not. AUTHOR
Vipul Ved Prakash, <mail@vipul.net> LICENSE
Copyright (c) 1999-2001, Vipul Ved Prakash. This code is free software; you can redistribute it and/or modify it under the ARTISTIC license (a copy is included in the distribution) or under the same terms as Perl itself. perl v5.8.8 2008-03-09 Math::Fibonacci(3pm)
All times are GMT -4. The time now is 01:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy