Need to extract jil file details in a excelsheet


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to extract jil file details in a excelsheet
# 8  
Old 03-02-2017
Try
Code:
awk -F: '
NR==1           {HD = "insert_job,machine,date_conditions,days_of_week,start_time,timezone,description,command,alarm_if_fail"
                 for (HDCnt=i=split(HD, HDArr, OFS); i>0; i--) SRCH[HDArr[i]] 
                 print HD
                }

function PRT()  {for (i=1; i<=HDCnt; i++)       {printf "%s%s", RES[HDArr[i]], i<HDCnt?OFS:ORS
                                                }
                 split ("", RES)
                }

/--- JOB/       {if (PR) PRT()
                 PR=1
                }

                {sub ("^  *", _)
                }

$1 in SRCH      {T = $1
                 sub ($1 FS " *", "")
                 sub (/[	 ][	 ]+.*$/, "")
                 RES[T] = $0
                }

END             {PRT()
                }
' OFS=","  file

Please be aware that the structure of the line containing insert_job differs from the data in post#1 (<TAB> separated, not spaces), so the splitting off of the job_type doesn't work any more.
# 9  
Old 03-03-2017
Hi Rudi, would it be possible for you to explain how this script works? Im still learning awk and theres a lot i dont understand in this script?
Many thanks
# 10  
Old 03-03-2017
That proposal is only a slight adaption of the script you posted as your attempt. How about you try to explain it here, and we jump in on the gaps that you can't cover?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract sentence and its details from a text file based on another file of sentences

Hi I have two text files. The first file is TEXTFILEONE.txt as given below: <Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text> <Text Text_ID="10155645315851111_10155645317023456"... (7 Replies)
Discussion started by: my_Perl
7 Replies

2. Shell Programming and Scripting

Perl : corrupted excelsheet while trying to open

Hi folks, I am trying to send the mail with spreadsheet attachment in perl.I am able to send the mail with xlsx attachment as well but not able to open the xlsx sheet.While opening the sheet I am receiving the corrupted message. Below is the code. use MIME::Lite; use Net::SMTP; ###... (1 Reply)
Discussion started by: scriptscript
1 Replies

3. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

4. Shell Programming and Scripting

Extract details from XML file

Hi , I have one xml file contains more than 60 lines. I need to extract some details from the file and store it in new file.Not the whole file Please find the xml file below: <?xml version="1.0" encoding="UTF-8"?> <DeploymentDescriptors xmlns="http://www.tibco.com/xmlns/dd"> ... (6 Replies)
Discussion started by: ckchelladurai
6 Replies

5. Shell Programming and Scripting

need to parse the jil file into an excel file

Hi I have the following as input /* ----------------- backupJIL ----------------- */ insert_job: backupJIL job_type: c command: autorep -J ALL -q > /home/autosys/...p/autosys_jil_bk machine: machine owner: autosys@machine permission: gx,ge,wx,we date_conditions: 1 days_of_week:... (7 Replies)
Discussion started by: ramky79
7 Replies

6. Shell Programming and Scripting

Contents and details extract problem asking...

Input: length align type 5453 8666 + length align portion 5453 8666 + length align range 5453 5616 + length align name 5453 6121 + length align age 5617 6121 + length align name 7214 7404 + length ... (11 Replies)
Discussion started by: patrick87
11 Replies

7. Shell Programming and Scripting

Help with excelsheet generation

Hi All, i have around 50 queries in sybase. We have a requirement where we need to write a unix script, which execute the query one by one & generate the excel sheet & send it to user. I have completed half of the part, where i am executing query one by one & putting the result into a .txt... (4 Replies)
Discussion started by: Amit.Sagpariya
4 Replies

8. Shell Programming and Scripting

i want to extract details for particular file

Hi i have following file uuid ( RO) : 62701790-60da-dd9a-669d-a563aac1c435 host-uuid ( RO): 5f3f668d-a7c7-4e5f-a4a6-6e90fafb50ed sr-uuid ( RO): 62103d07-e0aa-acf3-2d9f-414ad3377bd0 device-config (MRO): location: /dev/xapi/block ... (6 Replies)
Discussion started by: bp_vardhaman
6 Replies

9. Shell Programming and Scripting

execute a .jil file

hello all, Could anyone please suggest me as to how could we execute a .jil file. Thanks in advance for your help. (4 Replies)
Discussion started by: OSD
4 Replies

10. UNIX for Advanced & Expert Users

execute a .jil file

Hi All, Could anyone suggest me as to how could we execute a .jil file. Thanks in advance. (1 Reply)
Discussion started by: OSD
1 Replies
Login or Register to Ask a Question