The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
a question about UNIX 5.0.6 , help me please mrr53 UNIX for Dummies Questions & Answers 1 10-25-2007 12:09 AM
Unix History Question: Why are filenames/dirnames case sentsitive in Unix? deckard UNIX for Dummies Questions & Answers 3 03-26-2005 09:59 AM
Unix 10.2 question egress1 UNIX for Dummies Questions & Answers 5 07-24-2003 08:15 AM
unix to unix serial connection question typsam IP Networking 1 10-17-2002 01:39 PM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-29-2007
Registered User
 

Join Date: Nov 2004
Location: USA
Posts: 92
Talking Help with UNIX question

Folk;
I'm writing Shell script to extract fields out of log file onto a new file (output file) which i'm going to export into Excel. My question is How can i add a field description to the extracted fields in the output file which i can open using Excel. so when i open it using Excel i can see the column names on the top.
for example:
let's say the results of the output file will be like this

07:27:2007 Moe John moe@moe.com

where:
Moe: is the last person who viewed the page
John: Is the last person edited the page
moe@moe.com: is the e-mail for the last person viewed the field.

Now, I'd like the output of the extract to include the description of each field so when i open it using Excel i see on the top what's the field belong to. in other word, what can i add to the script to always include the description on the top of the results?

Thanks a lot folks.
Forum Sponsor
  #2 (permalink)  
Old 07-29-2007
jgt jgt is offline
Registered User
 

Join Date: Apr 2007
Location: 44.21.48N 80.50.15W
Posts: 348
Add a line at the beginning of the loop like:
echo "col1 hdg|col2hdg|col3hdg|" >output.file

Use either | as a separator, or the same as you are expecting between the fields on the detail line.
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0