- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need a perl script to find whether all of the ...
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
тАО07-07-2008 11:08 AM
тАО07-07-2008 11:08 AM
Need a perl script to find whether all of the column values present
columns;
a,b,c,d,e,f,g
there are million records, i need to check whether each row is containing 7 columns. if any of the row containing less than or more than 7 then those records should redirect to file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2008 11:23 AM
тАО07-07-2008 11:23 AM
Re: Need a perl script to find whether all of the column values present
Perl or 'awk' will easily do this. You don't way what your column delimiter is, so we will assume whitespace:
# perl -nae 'print if @F != 7' file > file.out
# awk 'NF<7||NF>7' file
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2008 02:53 AM
тАО07-08-2008 02:53 AM
Re: Need a perl script to find whether all of the column values present
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2008 03:11 AM
тАО07-08-2008 03:11 AM
Re: Need a perl script to find whether all of the column values present
Wouldn't this just be: :-)
awk 'NF != 7' file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-08-2008 03:24 AM
тАО07-08-2008 03:24 AM
Re: Need a perl script to find whether all of the column values present
> Dennis: > JRF Wouldn't this just be: :-)
awk 'NF != 7' file
Yup, of course! I guess I wanted to make the 'awk' look a bit longer. I too realized the silliness after I posted that :-}}
Regards!
...JRF...