HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Manipulating file with one single big line
Operating System - HP-UX
1834189
Members
2647
Online
110064
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
09-01-2010 12:38 PM
09-01-2010 12:38 PM
Hi there,
I have two problems here:
The first one is that I need to deal with a file with just one big line (see attachment) and ain't able to manipulate it with ed, ex, vi, view and so on. I think perl would be a good option but I don't know it...
The second one is that I need to replace every ocurrence of "2AU" string with the newline character, I think is "\n" and tried as follows:
cd $DIR
cat - << EOF | ed -s MyFile
1,$ s?2AU?\n?g
w MyFile
q
EOF
which actually isn't working....
Any help will be appreciated.
Regards!
I have two problems here:
The first one is that I need to deal with a file with just one big line (see attachment) and ain't able to manipulate it with ed, ex, vi, view and so on. I think perl would be a good option but I don't know it...
The second one is that I need to replace every ocurrence of "2AU" string with the newline character, I think is "\n" and tried as follows:
cd $DIR
cat - << EOF | ed -s MyFile
1,$ s?2AU?\n?g
w MyFile
q
EOF
which actually isn't working....
Any help will be appreciated.
Regards!
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2010 12:42 PM
09-01-2010 12:42 PM
Re: Manipulating file with one single big line
I forgot to mention that the attached file is a sample because the original is over 15 MB and the max size ITRC forums can deal with is 1 MB...
In fact with that size vi gives me a "Line too long" error and nothing is shown...
Regards!
In fact with that size vi gives me a "Line too long" error and nothing is shown...
Regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2010 01:04 PM
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2010 01:12 PM
09-01-2010 01:12 PM
Re: Manipulating file with one single big line
Thanks James!!
Perl did the trick as James posted...
Perl did the trick as James posted...
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