11-07-2012
Print numbers between two number ranges
Hi, I have a list.txt file with number ranges and want to print/save new all.txt file with all the numbers and between the numbers.
== list.txt ==
65936
65938
65942 && 65943
65945
65947 && 65949
65961
65963 && 65965
65966 && 65969
6597
after:
== all.txt ==
65936
65938
65942
65943
65945
65947
65948
65949
65961
65963
65964
65965
65966
65967
65968
65969
6597
Can you guy help me with this script in unix/linux (cygwin) ?
Thank you in advance.
BR,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
HI all
I'm trying to write an awk script to print the min and max value in a range(s) contained in another file - the range values are in $2
EG
114,7964,1,y,y,n
114,7965,1,y,y,n
114,7966,1,y,y,n
114,7967,1,y,y,n
114,7969,1,y,y,n
114,7970,1,y,y,n
114,7971,1,y,y,n
114,7972,1,y,y,n... (3 Replies)
Discussion started by: Mudshark
3 Replies
2. Shell Programming and Scripting
Is it possible for me to find numbers in a file by a range using grep?
like
cat data | cut -f1 | grep <info>
Im trying to find information and extract every amount that is less than a number (ie less than 75 or whatever)
Is this possible? (2 Replies)
Discussion started by: DKNUCKLES
2 Replies
3. Shell Programming and Scripting
Hi,
I have a question here that need to get advise from all of you. Let say I have a set of data
12347777
12359899
12347677
12360090
12347688
12359979
12359009
12367022
12346677
I need to count the number that appear in each numbering ranges and the output is like below:
Prefix ... (5 Replies)
Discussion started by: shirleyeow
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am trying to use AWK to do some editing and formating of large tables of numbers and I am having trouble getting it to work. For brevities sake, I won't show the whole table, but I have a sample set of code:
und$ awk '{($2+0) > 50;print $1}' temp
2000 147
2008 128
2002 100
1999 47... (2 Replies)
Discussion started by: ikerrin1@gmail.
2 Replies
5. Shell Programming and Scripting
Hello All,
I am having problem to find what is the smallest number from 90% of highest numbers from all numbers in file. I am having file with thousands of lines and hundreds of columns.
I am familiar mainly with bash but I am open to whatever suggestion witch will lead to the solutions.
If I... (11 Replies)
Discussion started by: Apfik
11 Replies
6. UNIX for Dummies Questions & Answers
Good day to everyone!
So, let's start :)
I have a file with a numbers in some ranges
for example:
1 10
49 72
...
and this file need to transform to:
1
2
3
4 (14 Replies)
Discussion started by: shizik
14 Replies
7. UNIX for Dummies Questions & Answers
##### (0 Replies)
Discussion started by: lucasvs
0 Replies
8. Shell Programming and Scripting
Looking for a simple way to convert ranges to a numerical sequence that would assign the original value of the range to the individual numbers that are on the range.
Thank you
given data
13196-13199 0
13200 4
13201 10
13202-13207 3
13208-13210 7
desired... (3 Replies)
Discussion started by: jcue25
3 Replies
9. Shell Programming and Scripting
Hi to all,
Please help on the following problem, I'm not where to begin, if awk or shell script.
I have pairs of ranges of numbers and I need to find the root or roots of ranges based on min Range and Max ranges
Example #1:
If min range is 120000 and max ranges 124999, it means that are... (5 Replies)
Discussion started by: Ophiuchus
5 Replies
10. Shell Programming and Scripting
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