Following may also help in same. This solution has been made according to input provided, like all row's (except first row) first column is coming continously 2 times and if any first column comes in odd number then it will only look for the last column and accordingly print.
1st: With your given example.
Output will be as follows. 2nd: With my tried example, where I have added one extra row at last.
Code is as follows.
Output is as follows.
Hope this helps.
Hello everyone,
I am writing a script to process data from the ATP world tour.
I have a file which contains:
t=540 y=2011 r=1 p=N409
t=540 y=2011 r=2 p=N409
t=540 y=2011 r=3 p=N409
t=540 y=2011 r=4 p=N409
t=520 y=2011 r=1 p=N409
t=520 y=2011 r=2 p=N409
t=520 y=2011 r=3 p=N409
The... (4 Replies)
I am a new user of Unix/Linux, so this question might be a bit simple!
I am trying to join two (very large) files that both have different # of cols and rows in each file.
I want to keep 'all' rows and 'all' cols from both files in the joint file, and the primary key variables are in the rows.... (1 Reply)
Hi,
In a file, I have to mark duplicate records as 'D' and the latest record alone as 'C'.
In the below file, I have to identify if duplicate records are there or not based on Man_ID, Man_DT, Ship_ID and I have to mark the record with latest Ship_DT as "C" and other as "D" (I have to create... (7 Replies)
Hello,
I have some tab delimited data and I need to move the last col. I could hard code it,
awk '{ print $1,$NF,$2,$3,$4,etc }' infile > outfile
but it would be nice to know the syntax to print a range cols.
I know in cut you can do,
cut -f 1,4-8,11-
to print fields 1,... (8 Replies)
Hi,
Please help with this.
I have several excel files (with and .xlsx format) with 10-15 columns each.
They all have the same type of data but the columns are not ordered in the same way.
Here is a 3 column example. What I want to do add the alphabet
from column 2 to column 3, provided... (9 Replies)
Hi
I have a file some thing like below. I want to bin the data. My Bin size is 100.
items number
HELIX1 75
HELIX6 160
HELIX2 88
HELIX19 114
HELIX5 61
HELIX4 167
it should consider each elemet under the number column and bin all the lines like below with 100... (7 Replies)
I want to specify field width based on the row with FTR.
I can acheive this if column width is constant with:
awk 'BEGIN { FIELDWIDTHS = "20 7 14 30" }{print $1,$4}' file
file:COL1 COL2 CL3 FTR
AA8 S2 CAT2 your comments
CC7 ... (5 Replies)
Hello Friends,
Hope all are doing fine.
Here is a tricky issue.
my input file is like this
07 10 14 20 21
03 15 27 30 32
01 10 11 19 30
02 06 14 15 17
01 06 20 25 29
Logic:
1. Please print another column as "0-0-0-0-0" for the first and second rows.
2. Read the first column... (4 Replies)
Hi ALL,
We have requirement in a file, i have multiple rows.
Example below:
Input file rows
01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212
01,1,102319,0,1,80,20,U,1,241,00000059420000006021
I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies
LEARN ABOUT PHP
imagepolygon
IMAGEPOLYGON(3) 1 IMAGEPOLYGON(3)imagepolygon - Draws a polygonSYNOPSIS
bool imagepolygon (resource $image, array $points, int $num_points, int $color)
DESCRIPTION imagepolygon(3) creates a polygon in the given $image.
PARAMETERS
o $
image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3).
o $points
- An array containing the polygon's vertices, e.g.:
+----------+------+
|points[0] | |
| | |
| | = x0 |
| | |
|points[1] | |
| | |
| | = y0 |
| | |
|points[2] | |
| | |
| | = x1 |
| | |
|points[3] | |
| | |
| | = y1 |
| | |
+----------+------+
o $num_points
- Total number of points (vertices).
o $color
- A color identifier created with imagecolorallocate(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
imagepolygon(3) example
<?php
// Create a blank image
$image = imagecreatetruecolor(400, 300);
// Allocate a color for the polygon
$col_poly = imagecolorallocate($image, 255, 255, 255);
// Draw the polygon
imagepolygon($image, array(
0, 0,
100, 200,
300, 200
),
3,
$col_poly);
// Output the picture to the browser
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>
The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagepolygon()
SEE ALSO imagecreate(3), imagecreatetruecolor(3).
PHP Documentation Group IMAGEPOLYGON(3)