Sponsored Content
Full Discussion: How to pad spaces
Top Forums Shell Programming and Scripting How to pad spaces Post 28899 by sarahho on Thursday 26th of September 2002 05:08:13 AM
Old 09-26-2002
Question How to pad spaces

Hello,
I have to write a function to input a Label and a number, and output a line as the following format:

Column 1 to 30: field label, left justified.
Column 31 to 45: A number, right justified.

The middle is padded with space. May I know how can I achieve this? (I don't know how to count the length of the label/number, and how to pad the spaces in between.)

Please help.

Many thanks.

Sarah
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

number pad?

Is there anyway to use the fr*$%& number pad in VI? Anyway? Anyway at all? All it does now random movements and inserts of characters (2 Replies)
Discussion started by: nelsonenzo
2 Replies

2. UNIX for Dummies Questions & Answers

touch pad not working

i just recenlty bought this hp pavillion laptop and installed linux on it.. i found that the touchpad doesn't work.. so i thought that hp pavillion doesn't have touchpad// silly me! // more recently I reinstalled fedora core 2.6.8-1-521 i686 and also xp professional... xp i found has touch pad and... (5 Replies)
Discussion started by: moxxx68
5 Replies

3. Solaris

number pad in vi

Hi, I'm on a sunos SVR4.0 box, my number pad works on the command line but does not work in vi any ideas how to enable it under vi? Thanks (5 Replies)
Discussion started by: c19h28O2
5 Replies

4. UNIX for Dummies Questions & Answers

pad Zeros

Hi can I know command to pad Zeros to a value I get 16 and I need to send 0000000016 (5 Replies)
Discussion started by: mgirinath
5 Replies

5. UNIX for Dummies Questions & Answers

pad

Hi All I need a pad a . to befoure a last digi ex 1258 --> 125.8 help to do thanks (4 Replies)
Discussion started by: nalakaatslt
4 Replies

6. Shell Programming and Scripting

Left pad spaces using awk or sed

Hi,I've a unix pipe delimited file as below f1|f2|f3|f4|f5|f6 My requirement is to pad spaces on the left to fields f2, f3 and f5. Field Lengths according to file layout f2 - 4 char f3 - 5 char f5 - 3 char If my record is as below 1|43|bc|h0|34|a Output record should be as below 1| 43| bc|h0|... (4 Replies)
Discussion started by: Soujanya_K
4 Replies

7. UNIX for Beginners Questions & Answers

Pad 0 to the right

I need to pad 0 to a number on the right. to make it 9 digit in total. My number is 2457 output should be 245700000 Please do wrap your samples/codes into CODE TAGS as per forum rules. (3 Replies)
Discussion started by: varun22486
3 Replies
GLGETOBJECTPTRLABEL(3G) 					   OpenGL Manual					   GLGETOBJECTPTRLABEL(3G)

NAME
glGetObjectPtrLabel - retrieve the label of a sync object identified by a pointer C SPECIFICATION
void glGetObjectPtrLabel(void * ptr, GLsizei bifSize, GLsizei * length, char * label); PARAMETERS
ptr The name of the sync object whose label to retrieve. bufSize The length of the buffer whose address is in label. length The address of a variable to receive the length of the object label. label The address of a string that will receive the object label. DESCRIPTION
glGetObjectPtrLabel retrieves the label of the sync object identified by ptr. label is the address of a string that will be used to store the object label. bufSize specifies the number of characters in the array identified by label. length contains the address of a variable which will receive the the number of characters in the object label. If length is NULL, then it is ignored and no data is written. Likewise, if label is NULL, or if bufSize is zero then no data is written to label. ERRORS
GL_INVALID_ENUM is generated if identifier is not one of the accepted object types. GL_INVALID_VALUE is generated if ptr is not the name of an existing sync object. GL_INVALID_VALUE is generated if bufSize is zero. If not NULL, length and label should be addresses to which the client has write access, otherwise undefined behavior, including process termination may occur. ASSOCIATED GETS
glGet() with argument GL_MAX_LABEL_LENGTH. SEE ALSO
glPushDebugGroup(), glPopDebugGroup(), glObjectLabel(), glGetObjectLabel(). COPYRIGHT
Copyright (C) 2012 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. AUTHORS
opengl.org opengl.org 06/10/2014 GLGETOBJECTPTRLABEL(3G)
All times are GMT -4. The time now is 12:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy