Page 1 of 1

parse file

Posted: Mon Nov 15, 2010 8:36 am
by raji33
Hi All,

I have to parse jill file and load the data into table previously i have used one filter command tr -s '\n' ',' in sequential file and is working fine as i have only one format but now the structure of it is varying from job to job how can i make it generic so that it can be used for any structure of jill file and i have to take the jill file from unix can any one share ideas.

Thanks in advance

Posted: Mon Nov 15, 2010 8:59 am
by ArndW
What is a "jill" file?

Posted: Mon Nov 15, 2010 9:15 am
by raji33
In autosys we scheduled the jobs and jill file is job information language which consists of details of job scheduled below is sample jil file

insert_job: template job_type: c
box_name: box1
command: ls -l
machine: localhost
owner: lyota01@TANT-A01
permission: gx,ge,wx,we,mx,me
date_conditions: 1
days_of_week: all
start_times: "15:00, 14:00"
run_window: "14:00 - 6:00"
condition: s (job1)
description: "description field"
n_retrys: 12
term_run_time: 60
box_terminator: 1
job_terminator: 1
std_out_file: /tmp/std_out
std_err_file: /tmp/std_err
min_run_alarm: 5
max_run_alarm: 10
alarm_if_fail: 1
max_exit_success: 2
chk_files: /tmp 2000
profile: /tmp/.profile
job_load: 25
priority: 1
auto_delete: 12

Posted: Mon Nov 15, 2010 9:26 am
by ArndW
The structure seems to be:

{commandkeyword}": "{Freeform Value}

which would seem to be ease to parse. What are you trying to do with the values and what, given your example, would be a "different format" jill file?

Posted: Mon Nov 15, 2010 9:32 am
by raji33
I mean there are more then 10 fields but some times may be only 5 or 6 fields may be present like

nsert_job: template job_type: c
box_name: box1
command: ls -l
machine: localhost
owner: lyota01@TANT-A01
permission: gx,ge,wx,we,mx,me
date_conditions: 1


and i want to accomplish my o/p
as


insert_job job_type box_name command machine ---------

templete c box1 ls-l localhost --------------

Posted: Mon Nov 15, 2010 12:31 pm
by Sreenivasulu
Autosys scheduled scripts are called 'jil' files

Regards
Sreeni

Posted: Mon Nov 15, 2010 12:41 pm
by raji33
sreeni thanks for your reply but iam looking for the approach do you have any suggestions

Posted: Mon Nov 15, 2010 12:42 pm
by vinothkumar
Are you talking about pivoting ?

Posted: Mon Nov 15, 2010 1:00 pm
by raji33
I know it is a vertical pivot but how to implement in server jobs cause their is no such stage as vertical pivot what ever the stage in server jobs covers only horizontal pivot

Posted: Mon Nov 15, 2010 1:48 pm
by chulett
Have you done an exact search for 'vertical pivot'? It has been explained here a number of times.

Posted: Tue Nov 16, 2010 2:32 am
by ArndW
I don't think a vertical pivot is useful here, since there are a number of lines which aren't used. I'd use a transform stage and stage variables to build up the output line from just those "keywords" which are relevant.

Posted: Tue Nov 16, 2010 3:32 am
by ray.wurlod
That would be the approach I would take also. Do you know all the possible fields that can occur in a jil file?

Posted: Thu Nov 18, 2010 10:14 am
by raji33
Yes i know what could be the stage variable in that case

Posted: Thu Nov 18, 2010 4:39 pm
by ray.wurlod
One for each field.