- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- format to output files ...
Operating System - HP-UX
1753774
Members
6796
Online
108799
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2011 04:59 PM
тАО02-08-2011 04:59 PM
hi
i ran a script and the output file has this
this is the line to get below information
echo $a $b $c
a_bcd_ea_e_ai_aa_aa 60 VALORES2
i_sdf_sdf_ 30 JUSTO
t_SF 20 CASA
jkjkkjkkjkkkjk 80 ARBOLES
i want the output as follows:
a_bcd_ea_e_ai_aa_aa 60 VALORES2
i_sdf_sdf_ 30 JUSTO
t_SF 20 CASA
jkjkkjkkjkkkjk 80 ARBOLES
i know a command called awk, but i do not know how to use it to get abowe format.
please your help.
Thanks.
i ran a script and the output file has this
this is the line to get below information
echo $a $b $c
a_bcd_ea_e_ai_aa_aa 60 VALORES2
i_sdf_sdf_ 30 JUSTO
t_SF 20 CASA
jkjkkjkkjkkkjk 80 ARBOLES
i want the output as follows:
a_bcd_ea_e_ai_aa_aa 60 VALORES2
i_sdf_sdf_ 30 JUSTO
t_SF 20 CASA
jkjkkjkkjkkkjk 80 ARBOLES
i know a command called awk, but i do not know how to use it to get abowe format.
please your help.
Thanks.
Solved! Go to Solution.
- Tags:
- printf
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2011 05:04 PM
тАО02-08-2011 05:04 PM
Re: format to output files ...
i want the output as follows:
xxxxxx xxxxxx xxxxxx
xxxxxx xxxxxx xxxxxx
xxxxxx xxxxxx xxxxxx
xxxxxx xxxxxx xxxxxx
xxxxxx xxxxxx xxxxxx
i mean, columns ordered.
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2011 12:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2011 06:50 AM
тАО02-09-2011 06:50 AM
Re: format to output files ...
Hi Manuales:
In keeping with "best practices", have a look at the 'printf(1)' manpages:
http://bizsupport.austin.hp.com/bc/docs/support/SupportManual/c02264041/c02264041.pdf
The 'printf' function can be used in shells, with 'awk' and with 'perl'.
# printf "%-8s%-8s%-8s\n" a b c
# echo "a b c"|awk '{printf "%-8s%-8s%-8s\n",$1,$2,$3}'
# perl -e 'printf "%-8s%-8s%-8s\n","a","b","c"'
Notice that in the shell example, no comma delimiters are used to separate the arguments to 'printf'.
Regards!
...JRF...
In keeping with "best practices", have a look at the 'printf(1)' manpages:
http://bizsupport.austin.hp.com/bc/docs/support/SupportManual/c02264041/c02264041.pdf
The 'printf' function can be used in shells, with 'awk' and with 'perl'.
# printf "%-8s%-8s%-8s\n" a b c
# echo "a b c"|awk '{printf "%-8s%-8s%-8s\n",$1,$2,$3}'
# perl -e 'printf "%-8s%-8s%-8s\n","a","b","c"'
Notice that in the shell example, no comma delimiters are used to separate the arguments to 'printf'.
Regards!
...JRF...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP