Sponsored Content
Top Forums Shell Programming and Scripting reading specific line from file Post 70103 by bhargav on Monday 25th of April 2005 09:52:16 PM
Old 04-25-2005
Quote:
Originally Posted by cool_boss2121

war of worlds:
200,300,400

to

war of worlds:
100,200,300,400 => append a 100, to the begining of this line..

Pls show some more light

thank you !!

Boss
Code:
echo -e "100,\c" ; sed -n '5 p' file1

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Reading specific part of file

I have a requirement to go to particular line in the file and from there read the contents till it meets a particular criteria. For eg if the contents of the file is like 81 abcd ------------------- Line 1 82 cdfe ------------------- Line 2 83 dfj ------------------- Line 3 84 df... (5 Replies)
Discussion started by: guptan
5 Replies

2. Shell Programming and Scripting

Reading from a specific line in a loop

Hello All, Request you to let me know how to do the below urgently.. Requirement File A Contains: for i in file A DEV1 DEV5 STG1 STG5 File B Contains: for j in file B DEV1 DEV5 STG1 STG5 (3 Replies)
Discussion started by: kaushikraman
3 Replies

3. Shell Programming and Scripting

Reading data from a specific line in a text file

hello, I have got the following problem that I am hoping someone can help with please. 1. I have got the following text file (below) , the columns data are 'Test Day', 'Board', 'Betting Number'. TEXT FILE ============================================ 1 3 02-01-27-28-29-30 0 1... (1 Reply)
Discussion started by: jermaine4ever
1 Replies

4. Shell Programming and Scripting

Reading data from a specific line in a text file

Hello, I have a problem which is giving me headache for days, can some please help. Please see code and text fiel below. Please see text in red for the problem I am facing # Program gets an input x from user while read line ; do echo... (4 Replies)
Discussion started by: jermaine4ever
4 Replies

5. UNIX and Linux Applications

Reading a file for specific words

Hi I have a script where the user calls it with arguments like so: ./import.sh -s DNSNAME -d DBNAME I want to check that the database entered is valid by going through a passwd.ds file and checking if the database exists there. If it doesn't, the I need to send a message to my log... (4 Replies)
Discussion started by: ladyAnne
4 Replies

6. Shell Programming and Scripting

Update a specific line in a file while reading sequentially

All, I know this is a very naive question but I could not find a way to get this working! I have a file with values like input.file Value1 Value2 server1/mylogin,mypasswd Value3 Value4 And in my code, I am reading the file line by line and processing it. #! /bin/ksh... (6 Replies)
Discussion started by: bharath.gct
6 Replies

7. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

8. UNIX for Dummies Questions & Answers

Reading a specific line from a file

Hi All, I am having 100 lines a text file say a.txt. I want read the 'nth' line from that file inside a script. Kindly tell us how to that. (2 Replies)
Discussion started by: boopathyvasagam
2 Replies

9. Shell Programming and Scripting

Extract specific line in an html file starting and ending with specific pattern to a text file

Hi This is my first post and I'm just a beginner. So please be nice to me. I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file? I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies
IMAGEPOLYGON(3) 							 1							   IMAGEPOLYGON(3)

imagepolygon - Draws a polygon

SYNOPSIS
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)
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy