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
тАО10-24-2008 09:46 AM
тАО10-24-2008 09:46 AM
Could you tell me the command for the following requirement,
I want to delete a line by finding a word AB at positions 431 and 432 in a file, and copy into a new file with the remaining lines.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2008 10:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2008 10:02 AM
тАО10-24-2008 10:02 AM
Re: grep
...and since you specifically mentioned 'grep' :
# grep -vE .{430}AB file > file.new
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2008 10:30 AM
тАО10-24-2008 10:30 AM
Re: grep
The command you provide perl and grep is not working
below is the error I got with grep
grep -vE .{430}PA file > file.new
grep: Invalid {} repetition.
the line starts with "1" and at positions 431 and 432 we have P & A, I want to delete those line of that type in the file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2008 11:01 AM
тАО10-24-2008 11:01 AM
Re: grep
OK, so the 'grep' gives:
grep: Invalid {} repetition.
This means that this version of 'grep' doesn't handle "large" repetions. That's why I suggested Perl in the first place, since it lacks silly limits. Adjust your counting to be from zero instead of one and use Perl.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2008 11:24 AM
тАО10-24-2008 11:24 AM
Re: grep
I am sending a test file, please tell me how to delete a line
In the file first letter as "1" in red and "PA" in red, PA Starts at position 431, I want to delete those type of line in every file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2008 11:52 AM
тАО10-24-2008 11:52 AM
Re: grep
which shouldn't ever be posted....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2008 04:32 PM
тАО10-24-2008 04:32 PM
Re: grep
>This means that this version of grep doesn't handle "large" repetitions.
You can simply add up repetitions:
grep -v '^.\{200\}.\{230\}AB' file > file.new
>In the file first letter as "1" and "PA", PA Starts at position 431
If that "1" is important you can use:
grep -v '^1.\{200\}.\{229\}AB' file > file.new
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2008 06:22 AM
тАО10-25-2008 06:22 AM
Re: grep
> Dennis: You can simply add up repetitions:
Yes, of course you can, but this is a nuisance. If the OP is fixed on 'grep', though, I agree that factoring is all that's left :-)
Then again, the above [ grep -vE .{430}PA file ] worked with GNU's 'grep' :-}}
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-25-2008 07:34 AM
тАО10-25-2008 07:34 AM
Re: grep
I tried with ur suggestions, but it failing and getting this error
grep: Invalid {} repetition