- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: File interrogation
Operating System - HP-UX
1758560
Members
2102
Online
108872
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
02-26-2003 08:44 AM
02-26-2003 08:44 AM
Solution
Hi Cathy,
Here is the modified script. Now do not run the individual commands as you may run into syntax issues. Just modify ABCXXXX.txt to match your filename and then run the script as it is. This will generate two files. ABCXXXX.txt.good and ABCXXXX.txt.bad.
----copy below---
#!/usr/bin/ksh
FILE=ABC1390.txt
MYNAME=$(echo $FILE|awk -F "." '{print $1}'|sed 's/ABC//g')
awk -v STR="$MYNAME" -F "," '$2 == STR {print $0}' $FILE > $FILE.good
awk -v STR="$MYNAME" -F "," '$2 != STR {print $0}' $FILE > $FILE.bad
----till here---
-Sri
Here is the modified script. Now do not run the individual commands as you may run into syntax issues. Just modify ABCXXXX.txt to match your filename and then run the script as it is. This will generate two files. ABCXXXX.txt.good and ABCXXXX.txt.bad.
----copy below---
#!/usr/bin/ksh
FILE=ABC1390.txt
MYNAME=$(echo $FILE|awk -F "." '{print $1}'|sed 's/ABC//g')
awk -v STR="$MYNAME" -F "," '$2 == STR {print $0}' $FILE > $FILE.good
awk -v STR="$MYNAME" -F "," '$2 != STR {print $0}' $FILE > $FILE.bad
----till here---
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2003 09:25 AM
02-26-2003 09:25 AM
Re: File interrogation
Hi Sri.
I finally got it to work but only by using nawk rather than awk.
Thanks for your valuable assistance. Enjoy the points!
Cathy
I finally got it to work but only by using nawk rather than awk.
Thanks for your valuable assistance. Enjoy the points!
Cathy
Life is too short not to have fun every single day
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP