- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: awk - single character field separator
Operating System - HP-UX
1753772
Members
5292
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
тАО04-19-2005 05:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2005 05:42 AM
тАО04-19-2005 05:42 AM
Re: awk - single character field separator
or
echo hello | sed "s/\(.\)/& /g" | awk '{printf("f1(%s) f2(%s) f3(%s) f4(%s) f5(%s)\n",$1,$2,$3,$4,$5);}
f1(h) f2(e) f3(l) f4(l) f5(o)
or
echo hello | sed "s/\(.\)/& /g" | awk '{print $5,$4,$3,$2,$1;}'
o l l e h
live free or die
harry d brown jr
echo hello | sed "s/\(.\)/& /g" | awk '{printf("f1(%s) f2(%s) f3(%s) f4(%s) f5(%s)\n",$1,$2,$3,$4,$5);}
f1(h) f2(e) f3(l) f4(l) f5(o)
or
echo hello | sed "s/\(.\)/& /g" | awk '{print $5,$4,$3,$2,$1;}'
o l l e h
live free or die
harry d brown jr
Live Free or Die
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2005 05:53 AM
тАО04-19-2005 05:53 AM
Re: awk - single character field separator
Wow! Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2005 06:51 PM
тАО04-19-2005 06:51 PM
Re: awk - single character field separator
Why to complicate
We can simply use:
echo hello | sed "s/./& /g" | awk '{print $5,$4,$3,$2,$1;}'
I know we can use any general os command in awk block, but somehow i am unable to figure out how.
Can someone help me start it out.
Thanks
We can simply use:
echo hello | sed "s/./& /g" | awk '{print $5,$4,$3,$2,$1;}'
I know we can use any general os command in awk block, but somehow i am unable to figure out how.
Can someone help me start it out.
Thanks
Vibhor Kumar Agarwal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2005 07:11 PM
тАО04-19-2005 07:11 PM
Re: awk - single character field separator
lt09:/home/merijn 110 > echo hello | perl -lne'$,=" ";print split//'
h e l l o
lt09:/home/merijn 111 > echo hello | perl -lne'$,=" ";print reverse split//'
o l l e h
lt09:/home/merijn 112 >
Enjoy, Have FUN! H.Merijn
h e l l o
lt09:/home/merijn 111 > echo hello | perl -lne'$,=" ";print reverse split//'
o l l e h
lt09:/home/merijn 112 >
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
- Tags:
- Perl
- « Previous
-
- 1
- 2
- Next »
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