I want to write a shell script to easy my job. Here is the description of task:
I have several files (d1.log, d2.log, d3.log etc)
with the common text as
Only values of variables will change in the different log files.
I want to grep "counter" and print the next 8 lines, which I am doing using:
I can do it for all files.
But Finally, I this information feed in a LOg file soemthing like this.
and similarly all d*.log file information in subsequent column of LOG file. In the end, I need to add this numbers on row basics and printed in the last column of the LOG file
1. You want more than 8 lines to be printed I guess, 12 lines?
--Yes it is correct.
2. You want to print the lines after "=== using photon counter===" right, not just any counter?
--true.
3. The last column, is it the sum of all the related values found in the log files?
--No, presently is is the NUMBERS from different d*.log file.
Please check the desired output form given below.
4. You want the accumulated info in one single file?
Yes, in single LOG file.
Need some more clarity on the desired output
desired output
Where, red - d1.log blue - d2.log
similarly there will be columns for other log file numbers bold are the addition of variables like "tot pho is" .
I hope , it is clear now? Please let me know if it is still confusing.
---------- Post updated at 07:02 AM ---------- Previous update was at 06:54 AM ----------
Hi again,
A simple question please.
Will it be possible to provide the information of "no of lines" & "LOG file name" information from terminal ?
& also If i could mention that the files it need to read should be *.log not any other file having "counter" text.
Hi,
There is some confusion. IT is working all fine, but somehow its changing the order of the text.
for example, here is the text in d*log file
wheres, I am getting following in the LOG file:
The script I am using is following:
The order is important for comparison..
Hello guys,
I am trying to filter some information out of a log file (example shortcut)
===== fspCIV0
/vol/vol0 -sec=sys,rw=fspsanp42.net,root=fspsanp42.net,nosuid
===== fcvCIS01
/vol/ARDW -sec=sys,rw
/vol/ARDW -sec=sys,rw
/vol/ARDW -sec=sys,rw,nosuid
/vol/ARDW -sec=sys,rw... (2 Replies)
HI all,
I have data in a file that looks like this:
1 HOW _ NNP NNP _ 3 nn _ _
2 DRUGS _ NNP NNP _ 3 nn _ _
3 ACT _ NNP NNP _ 0 null _ _
4 : _ ... (3 Replies)
Hi, I have the 3-column, tab-separated following data:
dot is-big 2
dot is-round 3
dot is-gray 4
cat is-big 3
hot in-summer 5
I want to remove all of those lines in which the values of Columns 1 and 2 are identical. In this way, the results would be as follows:
dot is-big 2
cat... (4 Replies)
Hello, everyone. I am working wtihin AIX 5.3, and I need to do the following:
read the each line of file BASE.txt
do XK {line contents}
if XK's output begins with "BASE", then append line contents to file "output.txt"
continue until end of file
Here is what I tried(unsuccessfuly):
... (4 Replies)
Hi Guys,
I'm trying to write an script that will be launched by a user. The script will look at a log file and check for alerts with the date (supplied by user) and a machine's hostname (also supplied by the user). I'm trying to get the output formatted just like the log file.
The logfile looks... (5 Replies)
Hye ShamRock
If you can help me with this difficult task for me then it will save my day
Logs :
==================================================================================================================
... (4 Replies)
I'm still new to bash script , I have a log file and I want to extract the items within the last 5 days . and also within the last 10 hours
the log file is like this : it has 14000 items started from march 2002 to january 2003
awk '{print $4}' < *.log |uniq -c|sort -g|tail -10
but... (14 Replies)
Good evening! Trying to make a shell script to parse log file and show only required information.
log file has 44 fields and alot of lines, each columns separated by ":".
log file is like:
first_1:3:4:5:6:1:3:4:5:something:notinterested
second_2:3:4:3:4:2
first_1:3:4:6:6:7:8
I am interested... (3 Replies)
Hi All,
In the script mentioned below uses a sftp command to login to the remote host and pull the files from the remote server. we want to log this inf to a log file . But it is not happening, the verbose information is just displayed on the screen but not to the log file when I run this... (1 Reply)
Hi Wise UNIX Crew,
I want to add 3 different columns to the file in which:
1. The first new column pulls in today's date and time
2. Second column one has a '0'
3. Third column has the word 'ANY' going down the column
If my file content is as follows:
"7","a","abc",123"... (1 Reply)