HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need a Script to strip out id # - HP 11.0
Operating System - HP-UX
1833758
Members
2562
Online
110063
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
Forums
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
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
05-13-2002 02:35 PM
05-13-2002 02:35 PM
Hi All,
I have a student access log that I need to
strip out the student id #. Here's a sample of
the log file:
38.164.211.67 - 411188 [13/May/2002:10:29:39 -0500] "GET /cgi-bin/student/register/me
nu.cgi HTTP/1.1" 200 1619
12.34.246.5 - 395630 [13/May/2002:10:29:43 -0500] "GET /cgi-bin/student/menu.cgi HTTP/
1.0" 200 2868
205.188.209.10 - 376553 [13/May/2002:10:29:46 -0500] "GET /cgi-bin/student/menu.cgi HT
TP/1.0" 200 2869
I want a script (I prefer c shell) to for
for ' - ' and then give me the next 6 characters which should always be numeric and
I want to just save the id #'s to an ascii
file.
So for the above log I want this output:
411188
395630
376553
I want it to search till it hits an end of
file. This script will run daily.
Then I will take the student id #'s and read a table (another script) to find out what site they are from and then I will write a report.
TIA,
Laurie
I have a student access log that I need to
strip out the student id #. Here's a sample of
the log file:
38.164.211.67 - 411188 [13/May/2002:10:29:39 -0500] "GET /cgi-bin/student/register/me
nu.cgi HTTP/1.1" 200 1619
12.34.246.5 - 395630 [13/May/2002:10:29:43 -0500] "GET /cgi-bin/student/menu.cgi HTTP/
1.0" 200 2868
205.188.209.10 - 376553 [13/May/2002:10:29:46 -0500] "GET /cgi-bin/student/menu.cgi HT
TP/1.0" 200 2869
I want a script (I prefer c shell) to for
for ' - ' and then give me the next 6 characters which should always be numeric and
I want to just save the id #'s to an ascii
file.
So for the above log I want this output:
411188
395630
376553
I want it to search till it hits an end of
file. This script will run daily.
Then I will take the student id #'s and read a table (another script) to find out what site they are from and then I will write a report.
TIA,
Laurie
How can you make the world a better place
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2002 02:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2002 02:42 PM
05-13-2002 02:42 PM
Re: Need a Script to strip out id # - HP 11.0
Hi
one simple command wil do it
cat filename | awk '{ print $3}'
this takes the space as the delimeter which exists after the - and after the student number.
cheers
John.
one simple command wil do it
cat filename | awk '{ print $3}'
this takes the space as the delimeter which exists after the - and after the student number.
cheers
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2002 02:44 PM
05-13-2002 02:44 PM
Re: Need a Script to strip out id # - HP 11.0
Hi
/usr/bin/csh
cat filename | awk '{ print $3}'
exit
/usr/bin/csh
cat filename | awk '{ print $3}'
exit
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP