Sponsored Content
Full Discussion: Chemist Needs Help
Top Forums UNIX for Dummies Questions & Answers Chemist Needs Help Post 302250528 by jim mcnamara on Thursday 23rd of October 2008 03:17:24 PM
Old 10-23-2008
The code above will work for you - plugin correct values for the red text below:
Code:
printf "%s\n%s\n%s\n%s\n" "comment" "x y x"  "101"  "4 7" > newfile

awk '/Done/ {print $2}'  file | \
 awk ' BEGIN { cnt =1.5 }
         {printf("%.1f  %s  42 69.42\n", cnt  $0); cnt+=.1 } >> newfile

Keep all quotes and punctuation characters as they are. They have meaning. Just use alphanumerics and . for a decimals and +- for signs on numbers if needed. File names cannot contain spaces or weird characters.

The number of rows you create in the output file is totally depdendent on the number of rows you read in via the first awk statement. ie., the number of lines read in from "file". Nothing is doing any counting for you. If you don't get 101 lines look to your input data.
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

Chemist Needs Help part II

Hello friends, I was wondering if you can help me with probably a simple function to you all: the sample looks and has this format. I was wondering how I could extract the first and second column starting including the line 'E/N and Ko' and not stop until there are no more lines. Thank you for... (5 Replies)
Discussion started by: gingburg
5 Replies
IMAGECOLORTRANSPARENT(3)						 1						  IMAGECOLORTRANSPARENT(3)

imagecolortransparent - Define a color as transparent

SYNOPSIS
int imagecolortransparent (resource $image, [int $color]) DESCRIPTION
Sets the transparent color in the given $image. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $color - A color identifier created with imagecolorallocate(3). RETURN VALUES
The identifier of the new (or current, if none is specified) transparent color is returned. If $color is not specified, and the image has no transparent color, the returned identifier will be -1. EXAMPLES
Example #1 imagecolortransparent(3) example <?php // Create a 55x30 image $im = imagecreatetruecolor(55, 30); $red = imagecolorallocate($im, 255, 0, 0); $black = imagecolorallocate($im, 0, 0, 0); // Make the background transparent imagecolortransparent($im, $black); // Draw a red rectangle imagefilledrectangle($im, 4, 4, 50, 25, $red); // Save the image imagepng($im, './imagecolortransparent.png'); imagedestroy($im); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imagecolortransparent() NOTES
Note Transparency is copied only with imagecopymerge(3) and true color images, not with imagecopy(3) or pallete images. Note The transparent color is a property of the image, transparency is not a property of the color. Once you have set a color to be the transparent color, any regions of the image in that color that were drawn previously will be transparent. PHP Documentation Group IMAGECOLORTRANSPARENT(3)
All times are GMT -4. The time now is 04:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy