I was able to work out on the file I mentioned. Btwn I have one question:
There is a line that i mentioned as
command: /home/btchproc/load_process/batch_files/batch_nna_brn_split_sum_fact3.sh m
For the above line this workds fine:
/command/{c=substr($2,1,index($2," ")-1)}
But its an issue if at the end of line there is no "m". Give me a solution which will work in both cases.
command: /home/btchproc/load_process/batch_files/batch_nna_brn_split_sum_fact3.sh
I did not tested , so please debug the code/test it by getting ".sh" position and then +2 to get "m". if it exists derive "c" differently , else $2 will be "c".
Sorry for my lateness to reply, I had not connected until now.
In order to handle when "m" appears or not, I have modify a little bit the line you mention from
to
The modified code is as follow:
Below I try to explain the code, I hope it helps and I hope be clear enough .
---------- Post updated at 10:21 AM ---------- Previous update was at 09:40 AM ----------
Cgkmal,
One more question. As I said i wrote script for one input which had following lines
watch_file: /home/btchproc/load_process/ftp_home/NNA_STRT.DAT
watch_file_min_size: 0
And I just wanted watch_file column in my output. But when I specified
/watch_file/{f=$2}
it showed the value of watch_file_min_size.
For now what I did is, I globally replaced the watch_file_min_size with min_size and got the desired output. But what wud be the correct way to do that.
Thanks
Last edited by Gangadhar Reddy; 03-02-2011 at 06:11 PM..
Cgkmal,
One more question. As I said i wrote script for one input which had following lines
watch_file: /home/btchproc/load_process/ftp_home/NNA_STRT.DAT
watch_file_min_size: 0
And I just wanted watch_file column in my output. But when I specified
/watch_file/{f=$2}
it showed the value of watch_file_min_size.
For now what I did is, I globally replaced the watch_file_min_size with min_size and got the desired output. But what wud be the correct way to do that.
In this case is needed to match the exact word, "watch_file",
Here is my input file:
______________________________________________________________________________
Start Dependent
Job Name Status Date Cond? Cond? Jobs?
-------- ------ --------------- ----- ---------
DWC$DAC103_acct_naked_opt INACTIVE No Yes Yes
Condition: s(DWC$DAC111_acct) and s(DWC$DAC141_cust) and
s(DWC$DAC131_acct_cust_rel) and s(DWC$DAC134_cust_classfn)
Atomic Condition Current Status T/F
---------------- -------------- ---
SUCCESS(DWC$DAF103_ACCNKTOPTSTRT.DAT) RUNNING F
Dependent Job Name Condition
------------------ ---------
RDS$DAC524_D_DWC_AC_NKDO_FACT SUCCESS(DWC$DAC103_acct_naked_opt)
WST$DAC437_R037_Uncovered_Opt SUCCESS(DWC$DAC103_acct_naked_opt)
I want the output as:
Job Name|Dependent Job Name
DWC$DAC103_acct_naked_opt|RDS$DAC524_D_DWC_AC_NKDO_FACT, WST$DAC437_R037_Uncovered_Opt
Note: The Depenedent job may be 1,2,3, etc or it may not be present too.
---------- Post updated at 04:49 PM ---------- Previous update was at 04:46 PM ----------
Quote:
Originally Posted by cgkmal
Hi Gangadhar Reddy,
No problem, I learning helping others.
In this case is needed to match the exact word, "watch_file",
you can do it by replacing this from
to
Regards
I have one more question - in case if the watch_file line is not present for some jobs. What happens now is the next time it get other jobs, the watch_file value is same as previous job. How can I make it void at the end of one loop so that next time if it doesn't get watch_file line there should be blank.
Last edited by Gangadhar Reddy; 03-08-2011 at 11:59 AM..
cat file1.txt
field1 "user1":
field2:"data-cde"
field3:"data-pqr"
field4:"data-mno"
field1 "user1":
field2:"data-dcb"
field3:"data-mxz"
field4:"data-zul"
field1 "user2":
field2:"data-cqz"
field3:"data-xoq"
field4:"data-pos"
Now i need to have the date like below.
i have just... (7 Replies)
I've been trying to figure this out for a while but I'm completely stumped. I have files with data in rows and I need to convert the data to columns. Each record contains four rows with a "field name: value" pair. I would like to convert it to four columns with the field names as column headers... (5 Replies)
Hi Friends
I have the following input data in 2 columns.
SNo 1
I1 Value
I2 Value
I3 Value
SNo 2
I4 Value
I5 Value
I6 Value
I7 Value
SNo 3
I8 Value
I9 Value
...............
................
SNo N (1 Reply)
Hi All,
I have some numbers in two different files
file1
4.21927E+00 4.68257E+00 5.56871E+00 3.59490E+01 7.65806E+01 1.39827E+02
and
file2
5.61142E+00 6.21648E+00 7.40152E+00 4.41917E+01 8.31586E+01 1.42938E+02
I would like to get file3
which contains in each column the sum of the... (6 Replies)
Hi all,
I have a problem to format data from different database queries into one look. The input data are as follows, every line has the same number of values but a different number of characters:
adata, bdata, cdata, ddata
fffdata, gdata, hdata, idata
jdata, kdata, ... (6 Replies)
Hi All,
I have the following file that has computer data for various pcs in my network...
Snap of the file is as follows
*******************************************************************************
Serial
123456
Computer IP Address
lo0:... (1 Reply)
Hi
I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example.
The original data record should be some thing like this
60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated.
Input:
test_data_1
1 2 90%
4 3 91%
5 4 90%
6 5 90%
9 6 90%
test_data_2
3 5 92%
5 4 92%
7 3 93%
9 2 92%
1 1 92%
...
Output:... (7 Replies)