The information is gathered from a log entry similar to the one below, and there are millions of it per day :
2) Is " Pattern " fixed text or should this be an argument to your script?
"Pattern" is what I want to grep, it is the "TID" I marked in red on the log example above.
3) Should "2001" and "Server1" be hard-coded in the final awk script, extracted from the input, sourced from a configuration file or passed as arguments to the script?
Yes. They are fixed value. This script will run in multiple servers, and in each server this information is different. In this case I pass this information here :
print "2001,Server1...
Talking about the code.
The first part the one starting with the :
is the header of the CSV file.
So I must keep this.
The first part of the script starting here :
...
Is where I grep all varitions of this :
ERROR_CODE will vary from case to case, there are several error, some of short description and other with a long description.
The Second Part :
Going from Error1 to Error19 is where I count the errors, based on the description.
And third part :
Is where my doubts start. Here is where I pass the format to a CSV file . here :
Is where I pass the amount of "Error 11" to the last position of the output file.
And the last part :
Is where I count all errors I gathered, considering that 2001, server1 are fixed and the :00:00 is the time.
I will upload one sample of the report.
And sorry for the long post. I just tried to put as much information as I could.
Hello people,
Need favour. The problem I have is that, I need to develop a unix shell script that performs recurring exports of data from a csv file to an oracle database. Basically, the csv file contains just the first name and last name will be dumped to an Unix server. The data from these... (3 Replies)
Since i'm new to scripting i'm findind it difficult to code a script. The script has to be an executable with 2 paramters passed to it.The Parameters are
1. The Control file name(.ctl file)
2. The Data file name(.csv file)
Does anybody have an idea about it? :confused: (3 Replies)
Hi,
I am currently working on a FTP script which would ftp to extranet servers from intranet server and gather logs based on timestamps in archive logs and by using a wildcard character in the present logs. I have the following in place
AAA="Extranet Server 1:Instance Extranet Server... (2 Replies)
Friends...This is the first time i am trying the report generation using shell script... any suggestions are welcome.
Is there a way to set the font size & color when i am exporting the data from unix shell script as a CSV file ?
The following sample data is saved as a .csv file in the... (2 Replies)
Hi,
I am trying to export the data to an .ixf file.
I have read the table names from a .dat file and those table name should be passed to the select * from schema.TABLENAME query .
I am trying the below loop
while read TABLE; do
db2 EXPORT TO ~/data_export/$TABLE.ixf OF IXF MESSAGES... (5 Replies)
Hi Guys,
I am new to shell script.I need your help to write a shell script.
I need to write a shell script to extract data from a .csv file where columns are ',' separated.
The file has 7 columns having values say column 1,column 2.....column 7 as below along with their values.
Name, Address,... (7 Replies)
Hi everyone,
I have a csv file which has data with different heading and column names as below.
Static Data Ingested
,,,,,,,,,,,,Known Explained Rejections
Column_1,column_2,Column_3,Column_4,,Column_6,Column_7,,% Column_8,,Column_9 ,Column_10 ,... (14 Replies)
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Hi all,
Is there any out there have a brilliant idea on how to export html table data as .csv or write to txt file with separated comma and also get the filename of link from every table and put one line per rows each table.
Please see the attached html and PNG of what it looks like.
... (7 Replies)