Sponsored Content
Full Discussion: Printing Columns in Unix
Top Forums Shell Programming and Scripting Printing Columns in Unix Post 302097567 by zazzybob on Monday 27th of November 2006 05:43:15 AM
Old 11-27-2006
You can easily add more formatting specifiers in your invocation of printf.

Read (assuming a Linux box, just use -s <section_no> on solaris)

man 1 printf
man 3 printf

For more....

You might want to think about using awk for this if it starts to get more complex than a few fields though.

Cheers
ZB
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Printing Problems in unix ... ( Bar-cdoe - Ip Printing)

Hi guys ... i need ur help with some printing problem in unix ... first prob. : i wanna print from my NCR unix to an Win NT , Ip based printing server ( HP JetDirect ) . My issue , is it possible to print directly to an Ip address from unix ? How do i make it work to get any results ?... (3 Replies)
Discussion started by: QuickSilver
3 Replies

2. Shell Programming and Scripting

printing columns

Here's what I wrote: #!/bin/sh d1=`grep Dialtone dialtone | awk '{print $2, $3, $4, $5, $6, $7, $8, $9}'` d2=`grep pstsys dialtone | awk '{print $12}'` echo "$d1 $d2" I expected the result to be this: Dialtone on host 1 slot 13 port 1, pstsys05 Dialtone on host 1 slot 13 port 1,... (3 Replies)
Discussion started by: cdunavent
3 Replies

3. UNIX for Dummies Questions & Answers

awk printing all columns after (but including) $n

I am piping an "ls -l" to awk so that all it returns is the file size, date, and file name. The problem is that some files may have spaces in the name so awk is only printing the first word in the file name. I won't know how many space-delimited words are in the filename, so what I want to do is... (2 Replies)
Discussion started by: cassj
2 Replies

4. UNIX for Dummies Questions & Answers

Perl, printing a string into columns

How can I use Perl to a take a string of 10 characters and print the last five characters of the string in columns 1-5 and the first five in columns 6-10? Result: 0123456789 5 0 6 1 7 2 8 3 9 4 (5 Replies)
Discussion started by: doubleminus
5 Replies

5. Shell Programming and Scripting

Printing columns

Im using awk to print columns. Basically I have a file with like 500 columns and I want to print the 200th-300th column and ignore the rest... how would I do it without putting $200, $201 .... $300 thanks (6 Replies)
Discussion started by: kylle345
6 Replies

6. Shell Programming and Scripting

Printing Fixed Width Columns

Hi everyone, I have been working on a pretty laborious shellscript (with bash) the last couple weeks that parses my firewall policies (from a Juniper) for me and creates a nifty little columned output. It does so using awk on a line by line basis to pull out the appropriate pieces of each... (4 Replies)
Discussion started by: cixelsyd
4 Replies

7. UNIX for Dummies Questions & Answers

Printing columns with header

Hi Gurus, I want to extract certain columns from file 2 and combine with file 1. I am using the following script to extract the columns. $ awk 'FNR>1{print $2, $9, FILENAME}' *.lim > out1 However, this script does not print the titles of the columns 2 and 9. Can somebody help me in... (1 Reply)
Discussion started by: Unilearn
1 Replies

8. UNIX for Dummies Questions & Answers

Sco Unix printing : jobs hangs in queue - printing via lp versus hpnpf

Hi, We have a Unix 3.2v5.0.5. I installed a printer via scoadmin, HP network printer manager with network peripheral name (hostname and ipadres are in /etc/hosts). This is the configuration file : Code: root@sco1 # cat configurationBanner: on:AlwaysContent types: simpleDevice:... (0 Replies)
Discussion started by: haezeban
0 Replies

9. Shell Programming and Scripting

Printing in columns

is there a short one-liner that can print out in columns instead of a long list? as in, instead of: apples oranges cats dogs sky monkey giraffe cups spoons tv cable it'll print something like this (properly indented of course :) ): (9 Replies)
Discussion started by: SkySmart
9 Replies

10. Shell Programming and Scripting

Printing multiple columns from a file

Hi, I need just to print the values of second and fourth column from a file # cat dispaly id Name Std Specialist 1 sss X mathematics 2 uyt IX geography 3 vcd X English i tried with some NF command.. I think am wrong.. Is there anyother way to print my requirement (3 Replies)
Discussion started by: Priya Amaresh
3 Replies
XPP(1)							      General Commands Manual							    XPP(1)

NAME
xpp - X Printing Panel SYNOPSIS
xpp [options] [files] ... DESCRIPTION
This manual page briefly documents the xpp command. This manual page was written for the Debian GNU/Linux distribution because the origi- nal program does not have a manual page. xpp (the X Printing Panel) is a graphical interface to the CUPS printing system. It can be used as a drop-in replacement for lpr(1) or lp(1) for programs that want to spool print jobs, or to print files directly from the command line. OPTIONS
The following options are recognized by xpp: -d destination -P destination Prints files to the named destination queue. -# copies Sets the number of copies to print from 1 to 100. -C name Sets the job name. -J name Sets the job name. -t name -T name Sets the job name. -l Specifies that the print file is already formatted for the destination and should be sent without filtering. This option is equivalent to "-oraw". -o option Sets a job option. -p Specifies that the print file should be formatted with a shaded header with the date, time, job name, and page number. This option is equivalent to "-oprettyprint" and is only useful when printing text files. -r Specifies that the named print files should be deleted after printing them. -q priority Specify the priority of the print job (from 1 to 100). COMPATIBILITY
The "c", "d", "f", "g", "i", "m", "v", and "w" options are not supported by XPP and will produce a warning message if used. SEE ALSO
lp(1),lpr(1),cupsd(8) AUTHOR
The X Printing Panel was written by Till Kamppeter <till.kamppeter@gmx.net> This manual page was written by Chris Lawrence <lawrencc@debian.org>, for the Debian GNU/Linux system (but may be used by others). The OPTIONS section was borrowed from the manual page for lpr(1). 10 May 2002 XPP(1)
All times are GMT -4. The time now is 01:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy