Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Unix: Printing neatly formatted columns (Read 1567 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Unix: Printing neatly formatted columns
26.11.13 at 09:19:55
 
Unix: Printing neatly formatted columns
 
To print a file in which data is put into columns that are not nicely aligned, the following command can be used. It reads the file, the columns can be references as $1, $2, etc and using the printf statement an explicit formatting can be given. I used the file name a.
 
awk '{ printf("%2s%15s%25s%25s%25s%25s%25s\n", $1, $2, $3,$4,$5,$6,$7)}' a
Back to top
 
 

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1