Sponsored Content
Top Forums Shell Programming and Scripting Using printf (or other?) to create variable fixed width text Post 302836761 by Scrutinizer on Wednesday 24th of July 2013 04:13:02 PM
Old 07-24-2013
Try regular shell:
Code:
printf "%-4s%-10s%s\n" "$1" "$2" "$3"

This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

fixed-width printf() output on an XmList on Solaris

This one is a bit of bugger and I'm not sure if it's entirely relevant to this board but here goes... I'm trying to produce some fixed width output to a List widget (X11/Motif GUI) So, I use something similar to: sprintf(Buffer, "%*d%*f", 20, some_integer, 20, some_float); This gives me a... (0 Replies)
Discussion started by: trido
0 Replies

2. Shell Programming and Scripting

Combining Two fixed width columns to a variable length file

Hi, I have two files. File1: File1 contains two fixed width columns ID of 15 characters length and Name is of 100 characters length. ID Name 1-43<<11 spaces>>Swapna<<94 spaces>> 1-234<<10 spaces>>Mani<<96 spaces>> 1-3456<<9 spaces>>Kapil<<95 spaces>> File2: ... (4 Replies)
Discussion started by: manneni prakash
4 Replies

3. Shell Programming and Scripting

Comparing column of variable length anf fixed width file

Hi, I have two input files. File1: ID Name Place 1-234~name1~Newyork 1-34~name2~Boston 1-2345~name3~Hungary File1 is a variable length file where each column is seperated by delimitter "~". File2: ID Country 1-34<<11 SPACES>>USA<<7 spaces>> 1-234<<10 SPACES>>UK<<8... (5 Replies)
Discussion started by: manneni prakash
5 Replies

4. Shell Programming and Scripting

Removing \n within a fixed width record

I am trying to remove a line feed (\n) within a fixed width record. I tried the tr -d ‘\n' command, but it also removes the record delimiter. Is there a way to remove the line feed without removing the record delimiter? (10 Replies)
Discussion started by: CKT_newbie88
10 Replies

5. Shell Programming and Scripting

How to split a fixed width text file into several ones based on a column value?

Hi, I have a fixed width text file without any header row. One of the columns contains a date in YYYYMMDD format. If the original file contains 3 dates, I want my shell script to split the file into 3 small files with data for each date. I am a newbie and need help doing this. (14 Replies)
Discussion started by: bhanja_trinanja
14 Replies

6. Shell Programming and Scripting

Replacing variable Text between fixed strings

Hello all, This is my first post and I hope you can help me out. I searched for quite some hours now and haven't found a simple solution to my problem. It is as following: I got this file: dl.dropbox.com/u/14586156/stuff/Bookmarks.plist and want to replace the Text between... (9 Replies)
Discussion started by: pasc
9 Replies

7. Shell Programming and Scripting

Comparing two fixed width file

Hi Guys I am checking the treads to get the answer but i am not able to get the answer for my question. I have two files. First file is a pattern file and the second file is the file i want to search in it. Output will be the lines from file2. File1: P2797f12af 44751228... (10 Replies)
Discussion started by: anshul_er
10 Replies

8. UNIX for Dummies Questions & Answers

convert # delimited text file to fixed width

Hello gurus, I have a file containing 5 columns delimited by '#' as shown in the example below: HRP1000-PLVAR#HRP1000-OTYPE#HRP1000-OBJID#HRP1000-BEGDA#HRP1000-ENDDA# 99991231#AU7129#000000000#1 PROCTER & GAMBLE# 99991231#TT4283#1000013883#21111 LAUNDRY# 99991231#TT4283#1000013884#21121 DISH... (3 Replies)
Discussion started by: chumsky
3 Replies

9. Shell Programming and Scripting

variable fixed-width fields

Hi there, CTL Port IO Rate(IOPS) Read Rate(IOPS) Write Rate(IOPS) Read Hit(%) Write Hit(%) Trans. Rate(MB/S) Read Trans. Rate(MB/S) Write Trans. Rate(MB/S) 09:36:48 0 A 136 0 135 97 100 ... (6 Replies)
Discussion started by: gray380
6 Replies

10. Shell Programming and Scripting

Joining fixed width files

Hi All, I need to join fixed width files on a column which is position 1 to 3 and need to have all the records from file1 file1.txt Cu1nullL1L2 Cu2nullL1L2 Cu3nullL1L2 file2.txt Cu1B1B2 Cu3B1B2 output.txt Cu1L1B1L2B2 Cu2L1L2 Cu3L1B1L2B3 I tried but not getting the expected... (12 Replies)
Discussion started by: shash
12 Replies
GLLINEWIDTH(3G) 														   GLLINEWIDTH(3G)

NAME
glLineWidth - specify the width of rasterized lines C SPECIFICATION
void glLineWidth( GLfloat width ) PARAMETERS
width Specifies the width of rasterized lines. The initial value is 1. DESCRIPTION
glLineWidth specifies the rasterized width of both aliased and antialiased lines. Using a line width other than 1 has different effects, depending on whether line antialiasing is enabled. To enable and disable line antialiasing, call glEnable and glDisable with argument GL_LINE_SMOOTH. Line antialiasing is initially disabled. If line antialiasing is disabled, the actual width is determined by rounding the supplied width to the nearest integer. (If the rounding results in the value 0, it is as if the line width were 1.) If |/x|>=|/y|, i pixels are filled in each column that is rasterized, where i is the rounded value of width. Otherwise, i pixels are filled in each row that is rasterized. If antialiasing is enabled, line rasterization produces a fragment for each pixel square that intersects the region lying within the rec- tangle having width equal to the current line width, length equal to the actual length of the line, and centered on the mathematical line segment. The coverage value for each fragment is the window coordinate area of the intersection of the rectangular region with the corre- sponding pixel square. This value is saved and used in the final rasterization step. Not all widths can be supported when line antialiasing is enabled. If an unsupported width is requested, the nearest supported width is used. Only width 1 is guaranteed to be supported; others depend on the implementation. Likewise, there is a range for aliased line widths as well. To query the range of supported widths and the size difference between supported widths within the range, call glGet with argu- ments GL_ALIASED_LINE_WIDTH_RANGE, GL_SMOOTH_LINE_WIDTH_RANGE, GL_SMOOTH_LINE_WIDTH_GRANULARITY. NOTES
The line width specified by glLineWidth is always returned when GL_LINE_WIDTH is queried. Clamping and rounding for aliased and antialiased lines have no effect on the specified value. Nonantialiased line width may be clamped to an implementation-dependent maximum. Call glGet with GL_ALIASED_LINE_WIDTH_RANGE to determine the maximum width. ERRORS
GL_INVALID_VALUE is generated if width is less than or equal to 0. GL_INVALID_OPERATION is generated if glLineWidth is executed between the execution of glBegin and the corresponding execution of glEnd. ASSOCIATED GETS
glGet with argument GL_LINE_WIDTH glGet with argument GL_ALIASED_LINE_WIDTH_RANGE glGet with argument GL_SMOOTH_LINE_WIDTH_RANGE glGet with argument GL_SMOOTH_LINE_WIDTH_GRANULARITY glIsEnabled with argument GL_LINE_SMOOTH SEE ALSO
glEnable(3G) GLLINEWIDTH(3G)
All times are GMT -4. The time now is 03:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy