I am new to BASH script. I am working on the script to parsing the log message . the followings are my task:
1. Read the multiple log files, such as N1-2009-10-01, N2-2009-10-2, N3-2010-01-02....
2. Parse the specific message, such as "aaaa"
3. If found the "aaaa" message in the log file and export to excel file
PS. i use zgrep:
and inside file looks like:
How can i use the script export these information into excel file into three columns, like
Thanks
Last edited by Franklin52; 04-06-2010 at 02:12 PM..
Reason: Please use code tags.
I tried that the NEW file seems NOT automatically fits in 3 columns in excel. I have to use "text to column" in excel . is there anyway to do this through the script?
...
I tried that the NEW file seems NOT automatically fits in 3 columns in excel. I have to use "text to column" in excel . is there anyway to do this through the script?
If you are talking about the awk script, then try to print a tab-delimited output. I believe a single comma prints a single space in awk.
A tab-delimited text file should open up as an Excel worksheet with column-splitted data without requiring you to do anything else.
same script:
1- i am using grep to find a string called: tinker panic 0 in a file /etc/ntp.conf
if the string is not there, i want to add the strings in /etc/ntp.conf file in the first line of the file. if not do nothing or exit.
2- also i want to add # in front of the following lines in... (0 Replies)
Hello everyone!!!! I am new to this forum ...I have a problem. And I thought that you are expert :) so you can help me with that... I have a text file with maaany lines. Every line begins with something like that:
<http aksjfskcuhrf kushkfsnus> <http sxnfrksehfsd gsdg r> I don't know if every... (16 Replies)
hi all
i'm trying to get a script working upon connection with pppd
According to docu this happens ina clean environment with a couple of variables set, namely $1,$2,...
To be able to execute the statements i included a path statement but i think i'm running into trouble with the variables -... (6 Replies)
Hello,
I'm confused (oh, yes). I'm running Linux at work. When I type 'echo $SHELL' I am told that I'm running tcsh. In /bin I note that both tcsh and bash are listed.
Question 1: Can I swap to run bash rather than tcsh and, if so, how will this affect my system? Is there any advantage to... (6 Replies)