Dears,I need your help in this, I have to create a report based on the output file generated by another program. I want to write a shell script for this. The output file generated every 15 minutes but i can’t open it until the end of day so the script will get the file as an input the file will be as follows:
Could you please try following and let me know if this helps you.
Output will be as follows.
If above doesn't match your requirement completely, then please show us Input_file(more samples) with expected output and all your conditions too, hope this helps. EDIT: Adding a non-one liner form on same.
Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
Please give a clear and detailed specification of your problem: input and output samples and a description of the logics and or algorithms connecting them, instead of hoping that someone out in them there hills will undergo the ordeal of scrutinizing your samples field by field, trying to find out WHAT you really need!
What in the solutions given to your other (nearly) identical problem does not fit? Where are you stuck? Any attempts from your side? Which "tags might not be updated"? What are the tags?
Please give a clear and detailed specification of your problem: input and output samples and a description of the logics and or algorithms connecting them, instead of hoping that someone out in them there hills will undergo the ordeal of scrutinizing your samples field by field, trying to find out WHAT you really need!
What in the solutions given to your other (nearly) identical problem does not fit? Where are you stuck? Any attempts from your side? Which "tags might not be updated"? What are the tags?
First of all thank you for your help, I came up with this
but didn't work probably once I ran it with the real data. the file input file thousand of lines. I got stuck where some of the tags will not updated which led to not map the headers
with the values because the above script prints the hears and then prints the values without mapping them.
I found this new requirement yesterday once i have tried with the real data.
I'm sorry for this confusion and many thanks for help.
Moderator's Comments:
Please use code tags as required by forum rules!
Last edited by RudiC; 04-17-2016 at 04:54 PM..
Reason: Added code tags.
Please consider a precise and detailed specification next time, like
- tags (or field names) are reflected in the header except for the first header field that is NOT found back in the data records but should be filled with data field 4
- fields are separated by ";"
- data field 3 is the time stamp and should be printed with every change after separation of its field name
- data field 4 needs to lose its field name and trailer and then to be printed as first field per line
- alpha only field name of arbitrary length is leading the fields, numerical field values follow without separator
- fields should be printed according to their position in the header.
etc. etc. etc.
Wildly guessing on what MIGHT BE required, I came up with
There can be thousand of .ksh in a specific directory where sql files are called from ksh.
Requirement is to loop through all the files content and generate a report like below:
Jobname Type type sqlname
gemd1970 sql daily tran01
gemw1971 sql weekly ... (6 Replies)
Dears,
I am new in shell world and I need your help in this, I have to create a report based on the output file generated by another program. I want to write a shell script for this.
The output file generated every 15 minutes but i can’t open it until the end of day so the script will get the... (3 Replies)
Hi All,
Hope all you are doing good! Need your help. I have an XML file which needs to be converted CSV file. I am not an expert of awk/sed so your help is highly appreciated!!
XML file looks like this:
<l:event dateTime="2013-03-13 07:15:54.713" layerName="OSB" processName="ABC"... (2 Replies)
Hello;
I need to generate a csv file that contains a list of all the files in a particular server (from the root directory ie: \) that have a permission stamp of 777. I would like to create the csv so that it contains the following:
server name, file name, full path name where file exists,... (17 Replies)
Friends,
This is what I need:
I will pass a CSV file as an input, and I want my shell to be reading that CSV file, and based on the parameters it should generate SQLs and write those SQL in a different file in the same location.
I'm new to Shell scripting. I'm currently working on a... (25 Replies)
Friends,
This is what I need:
I will pass a CSV file as an input, and I want my shell to be reading that CSV file, and based on the parameters it should generate SQLs and write those SQL in a different file in the same location.
I'm new to Shell scripting. I'm currently working on a... (1 Reply)
Hi Scripting Gurus,
I am trying to parse a csv file and generate a new output file.
The input file will be a variable length in turns of rows and columns.
output file will have 8 columns. we have three columns from the header for each set.
just to give little bit more clarification each row... (15 Replies)
Hi guys
I have a text report that consists of text in some parts and data in some parts.
e.g
Report for changes in cashflows
No changes were found
Report for changes in Bills
deal_num deal_date trader maturity log_creator
DF_234 20-5-2008 tman 20-5-2009 tman... (2 Replies)
I have a file which has some thousand records in the following format
File: input.txt ->
<option value="14333">VISWANADH VELAMURI</option>
<option value="17020">VISWANADHA RAMA KRISHNA</option>
I want to generate a csv file from the above file as follows
File: output.txt ->
... (4 Replies)