- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- help with script
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
Forums
Discussions
Discussions
Discussions
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
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
06-27-2005 07:25 PM
06-27-2005 07:25 PM
help with script
0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00
Is there any way to run a script on this file and report any lines with any column not equal to "0.00000000E+00"
Any help would be appreciated. attached is a sample text file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 07:31 PM
06-27-2005 07:31 PM
Re: help with script
See if this works for you:
# cat filename | xargs | grep -v "0.00000000E+00"
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 07:50 PM
06-27-2005 07:50 PM
Re: help with script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 07:53 PM
06-27-2005 07:53 PM
Re: help with script
will work for you. You can write a script like this:
for files in /home/testdir/*
do
echo $files
grep -v "0.00000000E+00" $files
echo "****************************"
done
Sudeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2005 07:56 PM
06-27-2005 07:56 PM
Re: help with script
for example It will exclude this line as well:
0.00000000E+00 4444444444 0.00000000E+00
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2005 01:44 AM
06-28-2005 01:44 AM
Re: help with script
grep -v "0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00" file
As this will only exclude lines which are all 0'd.
Now, that being said, if there is a variable number of entries per line, then a quick awk:
awk '{ count = 1;while (count < NF) { if ($count != "0.00000000E+00") { print; next } ; count++ } }' < file
Anyway, just some ideas. ;)
Note: with the above 'awk', if you want to only print out the different actual fields (instead of the entire line), change the 'print; next' to 'printf( "%s\n", $count)' .