Sponsored Content
Full Discussion: Indentation using awk
Top Forums UNIX for Dummies Questions & Answers Indentation using awk Post 302871109 by guy9050 on Tuesday 5th of November 2013 01:32:14 PM
Old 11-05-2013
Indentation using awk

I need to write an awk program who does this
Image

I'd be very grateful for any help,
Thanks a lot
 

10 More Discussions You Might Find Interesting

1. Programming

A question of indentation

Hi, Using GNU indent(1) I tried to indent a C source file which has no indentation (all lines start at column 1). The result I am trying to achieve, should look like this with the exception that only tabs are used for indentation (no spaces). Unfortunately, I couldn't find the appropriate... (1 Reply)
Discussion started by: Michael Iatrou
1 Replies

2. Programming

Emacs line indentation

Hi. I'm writing a document in Python, so indentation is crucial. I want to indent a whole section by exactly one tab. Any idea how to go about this? I'm using terminal emacs (no mouse input) Thanks for any help! (2 Replies)
Discussion started by: Rledley
2 Replies

3. Shell Programming and Scripting

Regarding indentation using unix script

I have piece of Informatica code in a file as : IIF(substr(flag,0,2)=1,false,IIF(flag= 1 ,0,NULL)) Please provide me with idea how to write a unix script which reads this file and write indented code into another file. The output in the second file should look as: ... (1 Reply)
Discussion started by: srikanth.ch
1 Replies

4. Shell Programming and Scripting

indentation and lowercase to uppercase

hi, i need to write a bash script that does two things. the program will take from the command line a file name, which is a C code, and an integer, which is the size of my indentation i would then have to indent every nested code by the number of columns provided by the user in the... (1 Reply)
Discussion started by: kratos.
1 Replies

5. Shell Programming and Scripting

Indentation help

Hi I have coded 300 line script.Its not indented properly.i am not good at indentation. I would appreciate your help on this. i want to use a 4 space indentataion.Hence if i "set tabstop=4" and use tabs for coding and if some one else open this script in their system it looks unindented since... (11 Replies)
Discussion started by: pinnacle
11 Replies

6. Shell Programming and Scripting

login error because of indentation isql

The below works/usr/sybase/bin/isql -S${SERVER} -D${DB} -U${ID} -P${PASSWD} -w 250 -n <<EOF > output The below is indented but doesnt work when /usr/sybase/bin/isql -S ${SERVER} \ -D ${DB} \ -U ${ID} \ -P ${PASSWD} \ -w 250 \ -n ... (1 Reply)
Discussion started by: pinnacle
1 Replies

7. Shell Programming and Scripting

Change indentation in scripts

Hi, I am a professional in writing shell scripts, and I am using a one-space indentation like this for i in file1 file2 do if then echo "$i" fi done so very deeply nested stuff still fits on my screen. At release time I usually double the indentation via sed 's/^ */&&/' to make... (8 Replies)
Discussion started by: MadeInGermany
8 Replies

8. Homework & Coursework Questions

Indentation using awk

1. The problem statement, all variables and given/known data: I need to write an awk program who does this (sorry its too big) http://i.stack.imgur.com/yzSqB.jpg 2. Relevant commands, code, scripts, algorithms: .. 3. The attempts at a solution (include all code and scripts): declaring a... (2 Replies)
Discussion started by: guy9050
2 Replies

9. UNIX for Beginners Questions & Answers

Indentation for Lists in html

An writing some html instructions to have text beside an image. The image is located on the left and I want the tect to appear on the right side of the image. The text includes a list. The problem is that the list boxes and not shifted. The text within the list align on the left with the... (20 Replies)
Discussion started by: kristinu
20 Replies

10. UNIX for Beginners Questions & Answers

Cshell if clause indentation

I would like to know if indentation is relevant for Cshell scripts. I wrote my code like this: if ((-e file1) && (-e file2)) then cat file1 > file10 cat file2 > file20 endifUsually I write my if clauses like this: if ((-e file1) && (-e file2)) then cat file1 > file10 ... (1 Reply)
Discussion started by: maya3
1 Replies
GETIMAGESIZE(3) 							 1							   GETIMAGESIZE(3)

getimagesize - Get the size of an image

SYNOPSIS
array getimagesize (string $filename, [array &$imageinfo]) DESCRIPTION
The getimagesize(3) function will determine the size of any given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML<IMG> tag and the correspondant HTTP content type. getimagesize(3) can also return some more information in $imageinfo parameter. Note Note that JPC and JP2 are capable of having components with different bit depths. In this case, the value for "bits" is the highest bit depth encountered. Also, JP2 files may contain multiple JPEG 2000 codestreams. In this case, getimagesize(3) returns the values for the first codestream it encounters in the root of the file. Note The information about icons are retrieved from the icon with the highest bitrate. PARAMETERS
o $filename - This parameter specifies the file you wish to retrieve information about. It can reference a local file or (configuration per- mitting) a remote file using one of the supported streams. o $imageinfo - This optional parameter allows you to extract some extended information from the image file. Currently, this will return the different JPG APP markers as an associative array. Some programs use these APP markers to embed text information in images. A very common one is to embed IPTC information in the APP13 marker. You can use the iptcparse(3) function to parse the binary APP13 marker into something readable. RETURN VALUES
Returns an array with up to 7 elements. Not all image types will include the channels and bits elements. Index 0 and 1 contains respectively the width and the height of the image. Note Some formats may contain no image or may contain multiple images. In these cases, getimagesize(3) might not be able to properly determine the image size. getimagesize(3) will return zero for width and height in these cases. Index 2 is one of the IMAGETYPE_XXX constants indicating the type of the image. Index 3 is a text string with the correct height="yyy" width="xxx" string that can be used directly in an IMG tag. mime is the correspondant MIME type of the image. This information can be used to deliver images with the correct HTTP Content-type header: Example #1 getimagesize(3) and MIME types <?php $size = getimagesize($filename); $fp = fopen($filename, "rb"); if ($size && $fp) { header("Content-type: {$size['mime']}"); fpassthru($fp); exit; } else { // error } ?> channels will be 3 for RGB pictures and 4 for CMYK pictures. bits is the number of bits for each color. For some image types, the presence of channels and bits values can be a bit confusing. As an example, GIF always uses 3 channels per pixel, but the number of bits per pixel cannot be calculated for an animated GIF with a global color table. On failure, FALSE is returned. ERRORS
/EXCEPTIONS If accessing the $filename image is impossible getimagesize(3) will generate an error of level E_WARNING. On read error, getimagesize(3) will generate an error of level E_NOTICE. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | Added icon support. | | | | | 5.2.3 | | | | | | | Read errors generated by this function down- | | | graded to E_NOTICE from E_WARNING. | | | | | 4.3.2 | | | | | | | Support for JPC, JP2, JPX, JB2, XBM, and WBMP | | | became available. | | | | | 4.3.2 | | | | | | | JPEG 2000 support was added for the $imageinfo | | | parameter. | | | | | 4.3.0 | | | | | | | | | | bits and channels are present for other image | | | types, too. | | | | | 4.3.0 | | | | | | | | | | mime was added. | | | | | 4.3.0 | | | | | | | Support for SWC and IFF was added. | | | | | 4.2.0 | | | | | | | Support for TIFF was added. | | | | | 4.0.6 | | | | | | | Support for BMP and PSD was added. | | | | | 4.0.5 | | | | | | | URL support was added. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #2 getimagesize(3) example <?php list($width, $height, $type, $attr) = getimagesize("img/flag.jpg"); echo "<img src="img/flag.jpg" $attr alt="getimagesize() example" />"; ?> Example #3 getimagesize (URL) <?php $size = getimagesize("http://www.example.com/gifs/logo.gif"); // if the file name has space in it, encode it properly $size = getimagesize("http://www.example.com/gifs/lo%20go.gif"); ?> Example #4 getimagesize() returning IPTC <?php $size = getimagesize("testimg.jpg", $info); if (isset($info["APP13"])) { $iptc = iptcparse($info["APP13"]); var_dump($iptc); } ?> NOTES
Note This function does not require the GD image library. SEE ALSO
image_type_to_mime_type(3), exif_imagetype(3), exif_read_data(3), exif_thumbnail(3). PHP Documentation Group GETIMAGESIZE(3)
All times are GMT -4. The time now is 10:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy