Sorry for the late response as I am out for some personal emergency. Thanks for your help, I am reviewing this now and will update you soon. Thanks again.
---------- Post updated at 07:31 AM ---------- Previous update was at 07:03 AM ----------
Of this file you only need the lines containing "STATUS: STARTING" and some ending notification. This could perhaps be "STATUS: SUCCESS", but somehow i don't believe that all jobs end that way - what other possible ending codes do you have, because your script will need to cover them too.
Let us go on, assuming for the moment that the only endng condition is "SUCCESS", this can be corrected later.
Next we make up some "rules" what to do with the respective lines, because at some point we need to read our input line by line:
- When we encounter a "STARTING" line we need to remember two things, the job name and the timestamp.
- When we encounter a "SUCCESS"-line we need to read also two things: the job name and the timestamp. But we don't need to store ("remember") them: the job name should be searched in our list of remembered (=started) jobs. If it is found, the stored starting time, the end time and the job name is printed.
The last point begs two questions: what are we going to do if we encounter a job with a start but no end? And what are we going to do with jobs with an end but no start?
Here is the skeleton of a shell script that implements what i said above. Neither is it very clever nor very mature, its intention to make it obvious how to implement common reasing like above into code. It also won't take the raised questions into account and implicitly assume that all jobs end with success and every starting job also ends and vice versa.
We start by filtering and displaying only the lines we are interested in:
Your above reply is very much correct and matches the exact requirement.
I tried the above script but it searches STARTING and SUCCESS for all job, whereas I need for specific job.
Also could you please tell what junk means ?
Can I use job name as $1 (1st arguement), so that it can changes as per requirement
Hi,
Is there some way to get formatted output in ksh? Something like a properly alligned tabular format. I tried adding '\t' to echo statements, but it doesn't come properly alligned
'hello' A simple Hello
'helloworld' A helloworld statement
I need the second coloumn to... (1 Reply)
var=12345
echo $var >>>12345
printf "%8.1f \n" $var >>> 12345.0
How to get this as 12,345?
I suppose I could break into sections by dividing by 1000 or 1000000.
But, is the a trick to this? (4 Replies)
Hi
I have the following records in a file
SABN YOURTUBE 000514 7256
SACN XYOUDSDF 000514 7356
SADN KEHLHRSER 000514 7656
SAEN YOURTUBE 000514 7156
SAFN YOURTUBE 000514 7056
I need to put this in the format like this
printf '%s %-50s %6s %-6s\n'
I am not going to read individual... (3 Replies)
Hi
I have the following lines in a file
SWPRC000001NOT STATED 1344
SWPRC000001NOT STATED 1362
SWPRC000001NOT STATED 1418
SWPRC000001NOT STATED 1436
SWPRC000001NOT STATED ... (6 Replies)
Hi
I have the input file as below
***TEST10067
00567GROSZ 099
00567CTCTSDS90
***TEST20081
08233GROZWEWE
00782GWERW899
***TEST30088
08233GROZWEWE
00782GWERW899
I am finding the lines starting with *** and outputing as below
TEST10067
TEST20081
TEST30088
I need a space between TEST1... (9 Replies)
Hello,
I am working on one script which is giving output as a pipe "|" separated
abcd | efgh | 20090745
abcdefgh | efg | 20090622
Can any one please help me i want it to be formatted as pipe will be aligned, or the output looks like a table. (2 Replies)
Dear All,
Good Day. I would like to hear your suggestions for the following problem:
I have a file with 5 columns with some numbers in 16 lines as shown below.
Input file:
Col 1 Col 2 Col 3 Col 4 Col 5
12 220 2 121 20
234 30 22 9... (3 Replies)
Can you please tell me how to just get only the output of dealers I & V information along with their subtotals in the next line of the file and create a new file, The dealer position along with corresponding totals may change everyday to any position above or below in the file, please help Thanks (2 Replies)
Hello,
I'm having trouble with formatting some text via the terminal. I can get it perfectly formatted, but when I try and copy paste the text from the output file it loses it's formatting. Very frustrating!
Basically I have 7 files (data data2 data3 data4 data5 data6 data7) containing a... (13 Replies)
Hi Techies,
I'm a newbie to PERL, Please help me with following problem.
I have an input text file like below
cat Input.txt
418673132,P
492538858,P
384535478,P
521522357,I
529435679,I
183617024,P
184414408,I
735510689,P
736238343,I
411642045,I
412690979,I
104232783,I (2 Replies)