Help with printing advance output format from a file
Hi,
below 'awk' code was given for my thread 'Help with printing output format from a file ' earlier, however script is not resulting expected output with below file content.
Code:
cat test_tes123.dml
record
string("\001") emp_num; /* CHAR(11) NOT NULL*/
date("YYYYMMDD") start_date = NULL; /* DATE NOT NULL*/
date("YYYYMMDD") end_date = NULL; /* DATE NOT NULL*/
string(1) status = NULL; /* CHAR(1) NOT NULL*/
string(1) flag = NULL; /* CHAR(1)*/
decimal("\001", maximum_length=12) unit_number = NULL; /* VARCHAR2(9)*/
string("\001", maximum_length=9) Sal= NULL; /* VARCHAR2(9) NOT NULL*/
string("\001", maximum_length=11) manager = NULL; /* VARCHAR2(11)*/
decimal("\001", maximum_length=12) d_no = NULL;
end;
-------
awk 'NF>1{s=s (s?";":x) $2; sub(/;$/,x,s)} END{print s}' test_tes123.dml
emp_num;start_date;end_date;status;flag;maximum_length=12);maximum_length=9);maximum_length=11);maximum_length=12)
---Where expected output is:
emp_num;start_date;end_date;status;flag;unit_number;Sal;manager;d_no
Could you please suggest solution for above query.
hai
i have a directory lib
in that lib directory i have 10 batch files.
step i have to do is 1) EXECUTE ALL THE FILES by using the command dwarfdump <filename>| grep DW_AT_SUN_command_line
and put the output in one text file.instead of executing the files for all the 10 files... (13 Replies)
Hi,
I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format.
Example:
File.txt
AP|{SSHA}VEEg42CNCghUnGhCVg==
APVG3|{SSHA}XK|"password"
AP3|{SSHA}XK|"This is test"
....
etc
---------
test.sh has... (1 Reply)
hi all
i have a file of the format
Time(starting from 0 in asc order) bytes service flags protocols
e.g.
0, 0, 0, 56, 56
1, 524, 3, 6, 75
1, 624, 0, 43, 53
2, 72, 0, 43, 80
3, ... (1 Reply)
I want to print the output of a db2 query, on to an unix file in a manner that the columns are separated by 'commas'. Please help me out..thanx in advance (1 Reply)
Hi Friends,
I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving...
File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Hi All,
The script below read the path and searches for the directories/subdirectories and for the files. If files are found in the sub directories then read the content of the all files and put the content in csv(comma delimted) format and the call the write to xml function to write the
std... (1 Reply)
Hi ,
i am generating some data by firing sql query with connecting to the database by my solaris box.
The below one should be the header line of my excel ,here its coming in separate row.
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM... (6 Replies)
Hi,
I need help in printing data in below format from file extensions with .dml, i have listed details below
file name is test_temp.dml, location in /home/users/test01/test_temp.dml
file content:
sample_type=
record
decimal(",") test_type;
date("DD-MM-YYYY")(",") test_date... (2 Replies)
I am having a bash script which is basically invoking a python program to validate the Source Query results against the target query results. I am placing all the queries in a .sql file.
I want to write to a Error log file incase if the syntax is wrong or if the column is not present in the... (4 Replies)
Hi All,
i am trying to print the df -h ouput in json format. using below script.
#!/usr/bin/env bash
df -h > /tmp/sdf
nawk '{print " "$1" "$2" "$3" "$4" "$5" "$6" "}' /tmp/sdf > /tmp/sdf1
nawk 'NR==1 { for (i=1; i<=NF; i++) { f = i }}{ print $(f), $(f), $(f), $(f), ... (2 Replies)
Discussion started by: sravani25
2 Replies
LEARN ABOUT SUSE
xentrace_format
XENTRACE_FORMAT(1) General Commands Manual XENTRACE_FORMAT(1)NAME
xentrace_format - pretty-print Xen trace data
SYNOPSIS
xentrace_format [ DEFS-FILE ]
DESCRIPTION
xentrace_format parses trace data in xentrace binary format from standard input and reformats it according to the rules in a file of defi-
nitions (DEFS-FILE), printing to standard output.
The rules in DEFS-FILE should have the format shown below:
event_id whitespace format
Each rule should start on a new line.
The format string may include format specifiers, such as: %(cpu)d, %(tsc)d, %(event)d, %(1)d, %(2)d, %(3)d, %(4)d, %(5)d
[ the `d' format specifier output in decimal, alternatively `x'
will output in hexadecimal and `o' will output in octal ]
These correspond to the CPU number, event ID, timestamp counter and the 5 data fields from the trace record. There should be one such rule
for each type of event to be pretty-printed (events which do not have formatting rules are ignored).
A sample format file for Xen's predefined trace events is available in the file tools/xentrace/formats in the Xen source tree.
Depending on your system and the rate at which trace data is produced, this script may not be able to keep up with the output of xentrace
if it is piped directly. In these circumstances you should have xentrace output to a file for processing off-line.
AUTHOR
Mark A. Williamson <mark.a.williamson@intel.com>
SEE ALSO xentrace(8), xentrace_cpusplit(1)Xen domain 0 utils 11 May 2004 XENTRACE_FORMAT(1)