HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- change to lowercase
Operating System - HP-UX
1832143
Members
3066
Online
110038
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
Forums
Discussions
Discussions
Discussions
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
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-05-2005 12:59 AM
02-05-2005 12:59 AM
I have a file containing two fields only:
i81LhMG00169:
I need to convert everything in the second field to lowercase, but need to retain the case in the first field.
Seems like there should be a one-liner in awk or sed that can do this. No perl please.
i81LhMG00169:
I need to convert everything in the second field to lowercase, but need to retain the case in the first field.
Seems like there should be a one-liner in awk or sed that can do this. No perl please.
fmartin@applicatorssales.com
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2005 01:30 AM
02-05-2005 01:30 AM
Solution
What constitues a fields in your file?
Are fields seperated by spaces or that colon?
Will there only ever be 2 fields?
For 2 'simple' fields the awk solution is:
awk '{print $1,tolower($2)}' your-file
For any more complex definition of fiels I would recommend a perl solution :-).
Just curious, as I am alway eager to learn, why not perl? It's regular expressions are very helpfull breaking down lines into fields and such.
Cheers,
Hein.
Are fields seperated by spaces or that colon?
Will there only ever be 2 fields?
For 2 'simple' fields the awk solution is:
awk '{print $1,tolower($2)}' your-file
For any more complex definition of fiels I would recommend a perl solution :-).
Just curious, as I am alway eager to learn, why not perl? It's regular expressions are very helpfull breaking down lines into fields and such.
Cheers,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2005 02:29 AM
02-05-2005 02:29 AM
Re: change to lowercase
Yeah it's just the two fields, a space between, although every mailID does end in a colon. Your awk solution works perfect - I'd forgotten about tolower().
Nothing against perl, I just don't know it. I have the O'Reilly Learning Perl book but haven't gotten to it yet.
Just need (as ever) a quick solution for today.
Nothing against perl, I just don't know it. I have the O'Reilly Learning Perl book but haven't gotten to it yet.
Just need (as ever) a quick solution for today.
fmartin@applicatorssales.com
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP