Sponsored Content
Top Forums Shell Programming and Scripting Need to extract jil file details in a excelsheet Post 302992851 by RudiC on Thursday 2nd of March 2017 11:01:27 AM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
LOCALTIME(5)							     localtime							      LOCALTIME(5)

NAME
localtime - Local timezone configuration file SYNOPSIS
/etc/localtime -> ../usr/share/zoneinfo/... DESCRIPTION
The /etc/localtime file configures the system-wide timezone of the local system that is used by applications for presentation to the user. It should be an absolute or relative symbolic link pointing to /usr/share/zoneinfo/, followed by a timezone identifier such as "Europe/Berlin" or "Etc/UTC". The resulting link should lead to the corresponding binary tzfile(5) timezone data for the configured timezone. Because the timezone identifier is extracted from the symlink target name of /etc/localtime, this file may not be a normal file or hardlink. The timezone may be overridden for individual programs by using the TZ environment variable. See environ(7). You may use timedatectl(1) to change the settings of this file from the command line. SEE ALSO
systemd(1), tzset(3), localtime(3), timedatectl(1), systemd-timedated.service(8) systemd 208 LOCALTIME(5)
All times are GMT -4. The time now is 01:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy