Sponsored Content
Full Discussion: Quick help on space padding
Top Forums UNIX for Dummies Questions & Answers Quick help on space padding Post 302156442 by Lokesha on Tuesday 8th of January 2008 06:23:56 AM
Old 01-08-2008
Error Quick help on space padding

Hi all,

I need to create a header record of width 121 charecter with below fields,
position 001-001 - 0
position 002-15 - filled with space
position 016-020 - date value
position 021-121 - filled with space

Iam using the below code:

echo 0"14 spaces"$date"100 spaces" >> output.txt

But I dont think this is correct approach. Could any one please correct me if Iam wrong?

With Regards / Lokesha R
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Padding issues

Hello, Structure padding & structure size are different on Compaq & HP UNIX. When structures are transfered via netfork from Compaq to HP will this be a problem? If yes, what can be the solution? Thanks, shilpa (2 Replies)
Discussion started by: informshilpa
2 Replies

2. UNIX for Dummies Questions & Answers

Padding

Hi Can anyone tell me how to pad zeroes on the left side to a numeric string in unix shell scripting Your answer is very much appreciated Thanks Vijay (2 Replies)
Discussion started by: vijaygopalsk
2 Replies

3. UNIX for Dummies Questions & Answers

text formating/Text space padding

Hi, How do I format the following? I have a for loop that retrieves me the path and file name of a file. In column fashion I would like to add the time and another variable containing the file's size. This will result in all the time being under each other and all the file size's being under... (6 Replies)
Discussion started by: hugow
6 Replies

4. Programming

Byte Padding

Hi, Can someone explain what is byte padding? For ex: struct emp{ char s; int b; char s1; int b1; long b3; char s3; } What will be the size of this structure? Thanks (6 Replies)
Discussion started by: naan
6 Replies

5. UNIX for Dummies Questions & Answers

Padding With White Space Between Variables

Dear Users, How do we pad with white space of particular length between two variables. For Example: Suppose i define the variables as follows: a='toyota' b='camry' c='honda' d='accord' e=`echo "$a"'\n'"$b"` f=`echo "$c"'\n'"$d"` If i do an echo on variables e and f i get :... (1 Reply)
Discussion started by: sandeep_1105
1 Replies

6. UNIX for Dummies Questions & Answers

Zero padding dates

I have a file with records containing dates like: SMPBR|DUP-DO NOT USE|NEW YORK||16105|BA5270715|2007-6-6|MWERNER|109||||JOHN||SMITH|MD|72211118||||||74559|21 WILMINGTON RD||D|2003-11-6|SL# MD CONTACT-LIZ RICHARDS|||0|Y|N||1411458| How can I get the date fields in each of my records to be... (1 Reply)
Discussion started by: ChicagoBlues
1 Replies

7. Shell Programming and Scripting

Padding with zeros.

Hi Friends, I would like to left pad with "0's" on first column say (width six) I have a large file with the format: FILE: 1: ALFRED 84378 NY 8385: JAMES 88385 FL 323: SMITH 00850 TX My output needs to be like: 000001: ALFRED 84378 NY 008385: JAMES 88385 FL 000323: SMITH... (10 Replies)
Discussion started by: sbasetty
10 Replies

8. Shell Programming and Scripting

Padding space with each column

Hi How do I a add space with each column . Each column has fixed size like 1 st column = 10 2nd column = 20 In each column data can be of variable length.So rest of the length should be space Frank Student Sue Admin (3 Replies)
Discussion started by: Chinky23
3 Replies

9. Shell Programming and Scripting

Padding a csv value with 0's

I have this csv file that I would like to sort on the 20th and 21st field. They are high lighted below. My challenge is that when I sort on those fields they are not in order as I would have liked. It seems like I have to pad those fields to the longest value in that fields data. ... (6 Replies)
Discussion started by: GroveTuckey
6 Replies
Gtk2::Box(3pm)						User Contributed Perl Documentation					    Gtk2::Box(3pm)

NAME
Gtk2::Box - wrapper for GtkBox HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::Box INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable Gtk2::Orientable METHODS
$box->set_child_packing ($child, $expand, $fill, $padding, $pack_type) o $child (Gtk2::Widget) o $expand (boolean) o $fill (boolean) o $padding (integer) o $pack_type (Gtk2::PackType) boolean = $box->get_homogeneous $box->set_homogeneous ($homogeneous) o $homogeneous (boolean) $box->pack_end ($child, $expand, $fill, $padding) o $child (Gtk2::Widget) o $expand (boolean) o $fill (boolean) o $padding (integer) $box->pack_end_defaults ($widget) o $widget (Gtk2::Widget) $box->pack_start ($child, $expand, $fill, $padding) o $child (Gtk2::Widget) o $expand (boolean) o $fill (boolean) o $padding (integer) $box->pack_start_defaults ($widget) o $widget (Gtk2::Widget) list = $box->query_child_packing ($child) o $child (Gtk2::Widget) $box->reorder_child ($child, $position) o $child (Gtk2::Widget) o $position (integer) integer = $box->get_spacing $box->set_spacing ($spacing) o $spacing (integer) PROPERTIES
'homogeneous' (boolean : default false : readable / writable / private) Whether the children should all be the same size 'spacing' (integer : default 0 : readable / writable / private) The amount of space between children CHILD PROPERTIES
'expand' (boolean : default true : readable / writable / private) Whether the child should receive extra space when the parent grows 'fill' (boolean : default true : readable / writable / private) Whether extra space given to the child should be allocated to the child or used as padding 'pack-type' (Gtk2::PackType : default "start" : readable / writable / private) A GtkPackType indicating whether the child is packed with reference to the start or end of the parent 'padding' (Glib::UInt : default 0 : readable / writable / private) Extra space to put between the child and its neighbors, in pixels 'position' (integer : default 0 : readable / writable / private) The index of the child in the parent ENUMS AND FLAGS
enum Gtk2::PackType o 'start' / 'GTK_PACK_START' o 'end' / 'GTK_PACK_END' SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::Box(3pm)
All times are GMT -4. The time now is 06:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy