I think we need more information.
For example, you could pad the lines with spaces at the end or the front.
Another choice is to expand the column width for each column to some max size, padding each column to that size.
What result do you need?
This pads spaces at the end:
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)
I am writing a C program which a part of it needs to padding zero in front of a string. The program will get a sting from an ASCII file which the maxium length of this string is 5 char long. The string can sometimes less the 5 char long. In order to make it with the same length '0's are being... (3 Replies)
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)
Is there a function in c that will allow me to pad variables?
I have an int that can't be longer than 10. I need to pad a numeric value with leading zeros
314
0000000314 (1 Reply)
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)
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)
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)
hi All
i am new to linux...
source txt ..
281-BUM-5M BUM-5M 0 0
282-BUM-5M BUM-5M 0 0
83-BUM-5M BUM-5M 0 0
is it possible to use bash script to convert to
(remove the "-" and fill up to 4 digit" ?
0281 BUM-5M BUM-5M 0 0
0282 BUM-5M BUM-5M 0 0
0083 BUM-5M BUM-5M 0 0
thanks a ... (5 Replies)
Hi all
Is there a way to pad the output of a bash script
see that code below
for i in `sed -n '/Start Printer/,/End Printer/p' /u/ab/scripts/hosts.conf | awk '!/^#/ {print $2}' | egrep -v 'broke|primera' `; do
pages=`snmpget -Ov -v1 -c public $i sysLocation.0 | awk '{print $2}'`
... (3 Replies)
I am passing input string,length, and the pad character.
input string=123
Pad char=#
Length=6
then the output should be:
###123
How we can do this?
Thanks (5 Replies)
Discussion started by: pandeesh
5 Replies
LEARN ABOUT NETBSD
pnoutrefresh
CURSES_PAD(3) BSD Library Functions Manual CURSES_PAD(3)NAME
curses_pad, newpad, subpad, prefresh, pnoutrefresh -- curses pad routines
LIBRARY
Curses Library (libcurses, -lcurses)
SYNOPSIS
#include <curses.h>
WINDOW *
newpad(int lines, int cols);
WINDOW *
subpad(WINDOW *pad, int lines, int cols, int begin_y, int begin_x);
int
prefresh(WINDOW *pad, int pbeg_y, int pbeg_x, int sbeg_y, int sbeg_x, int smax_y, int smax_x);
int
pnoutrefresh(WINDOW *pad, int pbeg_y, int pbeg_x, int sbeg_y, int sbeg_x, int smax_y, int smax_x);
DESCRIPTION
These functions create and display pads on the current screen.
The newpad() function creates a new pad of size lines, cols.
subpad() is similar to newpad() excepting that the size of the subpad is bounded by the parent pad pad. The subpad shares internal data
structures with the parent pad and will be refreshed when the parent pad is refreshed. The starting column and row begin_y, begin_x are rel-
ative to the parent pad origin.
The pnoutrefresh() function performs the internal processing required by curses to determine what changes need to be made to synchronise the
internal screen buffer and the terminal but does not modify the terminal display. A rectangular area of the pad starting at column and row
pbeg_y, pbeg_x is copied to the corresponding rectangular area of the screen buffer starting at column and row sbeg_y, sbeg_x and extending
to smax_y, smax_x.
The prefresh() function causes curses to propagate changes made to the pad specified by pad to the terminal display. A rectangular area of
the pad starting at column and row pbeg_y, pbeg_x is copied to the corresponding rectangular area of the terminal starting at column and row
sbeg_y, sbeg_x and extending to smax_y, smax_x.
The pnoutrefresh() and doupdate() functions can be used together to speed up terminal redraws by deferring the actual terminal updates until
after a batch of updates to multiple pads has been done.
RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following
values:
OK The function completed successfully.
ERR An error occurred in the function.
SEE ALSO curses_refresh(3), curses_window(3)NOTES
The subpad() function is similar to the derwin(3) function, and not the subwin(3) function.
STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.
HISTORY
The Curses package appeared in 4.0BSD.
BSD December 4, 2002 BSD