HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: CTRL-K in text files - How to Delete or expand...
Operating System - HP-UX
1827295
Members
1580
Online
109960
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
05-12-2005 09:27 AM
05-12-2005 09:27 AM
I have a large CSV file from a Filemaker DB. One field contains ersthwhile RICH formatted text data. I notice the file when VI'd have "^k" all throughout which is representative of Carriage Returns.
How do I remove or replace them so they expand to CR/LF in UNIX?
How do I remove or replace them so they expand to CR/LF in UNIX?
Hakuna Matata.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2005 09:35 AM
05-12-2005 09:35 AM
Solution
In UNIX, you do not want a CR/LF pair, you simply want a LF (Octal 012). We simply need to use tr to replace your Control-K's (Octal 013) with LF's.
tr "[\013]" "[\012]" < infile > outfile
tr "[\013]" "[\012]" < infile > outfile
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2005 09:39 AM
05-12-2005 09:39 AM
Re: CTRL-K in text files - How to Delete or expand to CR/LF?
A. Clay - if you're in my neck of the woods right now, I'll buy you a tall glass of Kirin Lager.
Man you hit it.. I was as well close after I did an "od -c file" and noticed those ^Ks are actually CHR 013's.
Many many thanks!
Man you hit it.. I was as well close after I did an "od -c file" and noticed those ^Ks are actually CHR 013's.
Many many thanks!
Hakuna Matata.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2005 09:40 AM
05-12-2005 09:40 AM
Re: CTRL-K in text files - How to Delete or expand to CR/LF?
I was also earlier trying dos2ux (reverse of ux2dos) but to no avail.
Thanks for the tr tip once more!
Thanks for the tr tip once more!
Hakuna Matata.
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP