- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Formatting Script needed
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
тАО02-02-2009 01:43 PM
тАО02-02-2009 01:43 PM
Formatting Script needed
We need to populate an excel sheet with the information we have from logs. I am attaching the document for your reference and described what we have and what we need.
A shell script preferably using sed or awk instead of perl will be highly appreciable.
Thanks,
Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 01:52 PM
тАО02-02-2009 01:52 PM
Re: Formatting Script needed
Let me guess, you're going to present this to your boss and pretend that you did it...right?
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 02:17 PM
тАО02-02-2009 02:17 PM
Re: Formatting Script needed
Thanks,
Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 03:13 PM
тАО02-02-2009 03:13 PM
Re: Formatting Script needed
grep -v "Customer count" customercount_20090201-155501 |egrep '14|15|16|17|18|19|20|21|22'|awk -F- '{print $2}'| tr -s '\n'
2
3
1
2
3
5
6
4
4
My tr doesnt seem to be working as I want it to be ...
I want the following as my result..
2 3 1 2 3 5 6 4 4
How do I remove the newlines here...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 03:28 PM
тАО02-02-2009 03:28 PM
Re: Formatting Script needed
Now trying to find a way it can be pasted easily into an excel file... I need some tabs in between the output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 03:28 PM
тАО02-02-2009 03:28 PM
Re: Formatting Script needed
for FILE in customer*
do
DATE=${FILE%-*}
DATE=${DATE#*_}
print -n "$DATE,"
grep -v "customer count" $FILE |\
sort -n |\
while read HOUR HYPEN COUNT
do
print -n "$COUNT,"
done
done
20090131,6,3,4,6,5,9,6,4,3,4,9,3,3,
20090201,5,4,3,2,3,1,2,3,5,6,4,4,1,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 04:01 PM
тАО02-02-2009 04:01 PM
Re: Formatting Script needed
I got the tab in between the output but I am still not able to paste the text in different columns in excel. How do I get the output so that I am able to paste each on the tab separated digits in separate columns.
Thanks,
Allan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2009 04:13 PM
тАО02-02-2009 04:13 PM
Re: Formatting Script needed
At that point a pop-up window will ask for the source. Select your file.
A new pop-up window will ask for settings. You tell in Delimited and select "Next>".
At this pop-up window you select that the data is delimited by commas and again select "Next>".
At the final window let Excel know that the data in column 1 is a Date using the YMD format and select "Finish". OK, the last window asks if you want a new worksheet.
There are lots of assumptions and potential problems that we cannot solve for you. This is intended to show you enough to get started. Good luck!