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.
There will be some scenario where files are not coped for some reason maybe network failure for example so there will be gap in the list of files.
So the list above may be something like below where there is a gap in a supposed to consecutive list.
Does anyone know a quick way of checking for what is the missing number in the consecutive range?
At the moment, what I am doing is I am cutting the list into 3 separate list based on the first character. The first digit is the transaction group, the second digit is the transaction number and the 3rd digit is the db id which is a constant.
Then I am reading each new list, set the first number as a 'base' and then incrementing it by 1, assign it to a variable and then comparing that number with what I read next. If they don't match, the I print that as the missing number or gap. It is a very long tedious process.
I am hoping someone know a trick of checking what is the missing number in the consecutive range and print it.
I don't want to insert the missing number in the existing list, I will be re-directing it to an exception list so I know what transaction log is missing that I will have to re-copy.
Also in some instance, I will have a listing where there will be duplicates in the listing like below
This is where the database log was send to the DR site multiple times. Is there a way to check for which lines are duplicates and how many lines/rows are there?
For example, from the latest listing above, 1_79812_01234567.arc has 3 entries, 2_86756_01234567.arc has 3 entries, 3_82694_01234567.arc has 2 entries and so on.
Any advice will be much appreciated. Thanks in advance.
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)
I have a text file in the following format
....
START
1,1
2,1
3,1
..
..
9,1
10,1
END
....
I want to change to the output to
....
START
1,1
2,1
3,1
.. (4 Replies)
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 (2 Replies)
I need help with a script that will remove all HTML tags from an HTML document and remove any consecutive duplicate lines, and save it as a text document. The user should have the option of including the name of an html file as an argument for the script, but if none is provided, then the script... (7 Replies)
Hi,
I have an input file of the following style
input.txt
The 4000 at the end indicates the total no. of columns in that row.
I would like to replace all -1s with consecutive 1 and 2 and print the whole line again.
So, the output would be
output.txt
Thanks in advance. (7 Replies)
Hi all,
I have two (2) sets of files that are based on some snapshots of database that I want to merge and insert any missing sequential number.
Below are example representation of these files:
file1:
DATE TIME COL1 COL2 COL3 COL4 ID
01/10/2013 0800 100 ... (3 Replies)
Hello,
I'm trying to remove the duplicate consecutive lines with specific string "WARNING".
File.txt
abc;
WARNING 2345
WARNING 2345
WARNING 2345
WARNING 2345
WARNING 2345
bcd;
abc;
123
123
123
WARNING 1234
WARNING 2345
WARNING 2345
efgh; (6 Replies)
Discussion started by: Mannu2525
6 Replies
LEARN ABOUT SUNOS
mlib_graphicsdrawarc_32
mlib_GraphicsDrawArc(3MLIB)mlib_GraphicsDrawArc(3MLIB)NAME
mlib_GraphicsDrawArc, mlib_GraphicsDrawArc_8, mlib_GraphicsDrawArc_32, mlib_GraphicsDrawArc_X_8, mlib_GraphicsDrawArc_X_32, mlib_Graphics-
DrawArc_A_8, mlib_GraphicsDrawArc_A_32, mlib_GraphicsDrawArc_B_8, mlib_GraphicsDrawArc_B_32, mlib_GraphicsDrawArc_AB_8, mlib_Graphics-
DrawArc_AB_32 - draw arc
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>
mlib_status mlib_GraphicsDrawArc_8(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c);
mlib_status mlib_GraphicsDrawArc_32(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c);
mlib_status mlib_GraphicsDrawArc_X_8(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c, mlib_s32
c2);
mlib_status mlib_GraphicsDrawArc_X_32(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c,
mlib_s32 c2);
mlib_status mlib_GraphicsDrawArc_A_8(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c);
mlib_status mlib_GraphicsDrawArc_A_32(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c);
mlib_status mlib_GraphicsDrawArc_B_8(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c, mlib_s32
a);
mlib_status mlib_GraphicsDrawArc_B_32(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c,
mlib_s32 a);
mlib_status mlib_GraphicsDrawArc_AB_8(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c,
mlib_s32 a);
mlib_status mlib_GraphicsDrawArc_AB_32(mlib_image *buffer, mlib_s16 x, mlib_s16 y, mlib_s32 r, mlib_f32 t1, mlib_f32 t2, mlib_s32 c,
mlib_s32 a);
Each of the mlib_GraphicsDrawArc_*() functions draws an arc with the center at (x, y), radius r, start angle t1, and end angle t2.
Each of the mlib_GraphicsDrawArc_X_*() functions draws an arc in Xor mode as follows:
data[x,y] ^= c ^ c2
Each of the mlib_GraphicsDrawArc_A_*() functions draws an arc with antialiasing.
Each of the mlib_GraphicsDrawArc_B_*() functions draws an arc with alpha blending as follows:
data[x,y] = (data[x,y] * (255 - a) + c * a) / 255
Each of the mlib_GraphicsDrawArc_AB_*() functions draws an arc with antialiasing and alpha blending.
Each of the functions takes some of the following arguments:
buffer Pointer to the image into which the function is drawing.
x X coordinate of the center.
y Y coordinate of the center.
r Radius of the arc.
t1 Start angle of the arc in radians.
t2 End angle of the arc in radians.
c Color used in the drawing.
c2 Alternation color.
a Alpha value for blending. 0 <= a <= 255.
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
mlib_GraphicsDrawCircle(3MLIB), mlib_GraphicsDrawEllipse(3MLIB), attributes(5)
3 Mar 2005 mlib_GraphicsDrawArc(3MLIB)