- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How manage very long line
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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-12-2008 01:24 AM
тАО09-12-2008 01:24 AM
I have a file, each line inside has a variable lenght and is terminated by a carriage return.
Line lenght may be long 4000 char.
In each line I have to substitude the the word 'blabla' with word 'ccccc'.
I am not able to manage so long line with awk or vi, each time i get the error 'line lenght too long'.
Foe example when I use awk the error is:
awk: Input line 0 cannot be longer than 3,000 bytes.
Thank for any suggestion.
Angelo
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 01:34 AM
тАО09-12-2008 01:34 AM
Re: How manage very long line
get a copy of GNU awk and put its directory as the first into tha $PATH of your scripts.
GNU awk does not have that limit, IIRC...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 02:13 AM
тАО09-12-2008 02:13 AM
Re: How manage very long line
as per other forum I checked gnu awk at this site http://hpux.cs.utah.edu/ but it has been removed.
Do you know any other site ?
thanks
Angelo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 02:17 AM
тАО09-12-2008 02:17 AM
Re: How manage very long line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 04:06 AM
тАО09-12-2008 04:06 AM
Re: How manage very long line
I don't think sed has this limitation...
Try:
sed -e 's/blabla/ccccc/g' myfilename
HTH
Duncan
I am an HPE Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 05:20 AM
тАО09-12-2008 05:20 AM
Re: How manage very long line
Perl doesn't have limitations like this.
# perl -pe 's/blabla/ccccc/g' myfilename
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 05:53 AM
тАО09-12-2008 05:53 AM
Re: How manage very long line
using both sed and perl each command goes in stuck with no error.
The ony thing i can do at that point is to kill the process, but the file is not changed.
rgd
angelo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2008 10:43 AM
тАО09-12-2008 10:43 AM
Solution> using both sed and perl each command goes in stuck with no error
You also said that a carriage-return delimits each line.
If you truly have only carriage-returns (\015) without newlines (\012), then seeing any output on your terminal won't occur. This may be very misleading. Do:
# perl -pe 's/blabla/ccccc/g' myfilename > myfilename.new
...or, update in-place while preserving a backup copy of the original file as "*.old" :
# perl -pi.old -e 's/blabla/ccccc/g' myfilename
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2008 12:11 AM
тАО09-15-2008 12:11 AM
Re: How manage very long line
thanks to everybody, overall JRF.
Angelo