- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to select lines from file?
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-18-2008 03:30 AM
тАО09-18-2008 03:30 AM
I have a file with lines like :
aabbddcc1234xxxx
aa1234cc2345yyyy
aa1234xx3456zzzz
How can i select the lines that have certain string in caracters 10-14 ?
Solved! Go to Solution.
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2008 03:34 AM
тАО09-18-2008 03:34 AM
Re: how to select lines from file?
grep aa1234cc /path/filename
Just a quick thought,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2008 03:40 AM
тАО09-18-2008 03:40 AM
Re: how to select lines from file?
aabbddcc1234xxxx
aa1234cc2345yyyy
aa1234xx3456zzzz
when i to select the line with caracters 8-11 to be 1234 , grep will also show other lines.. as grep does not use the place of the caracters in the line..
Can awk do this ?
What will be the command.. ?
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2008 03:44 AM
тАО09-18-2008 03:44 AM
Re: how to select lines from file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2008 03:45 AM
тАО09-18-2008 03:45 AM
Re: how to select lines from file?
grep '.......1234*' /path/filename
That's seven dots or periods then 1234 and anything else after that...
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2008 03:46 AM
тАО09-18-2008 03:46 AM
Re: how to select lines from file?
another quick thought:
grep -E "........1234*" ./infile
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2008 04:04 AM
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2008 05:18 AM
тАО09-18-2008 05:18 AM
Re: how to select lines from file?
This was what I was looking for!!!
regards,
Henk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-19-2008 01:23 AM
тАО09-19-2008 01:23 AM
Re: how to select lines from file?
(Typically line positions start with 1, your example seems to be 0.)
An old thread about it:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=76665
Or for your case for columns 9-12.
grep '^.\{8\}1234' file