12-27-2017
Thanks RudiC and Don for reply .
Just trying to make it more precise for better understanding ( Dropping the insert idea into DB2 tables )
1.you want the number of lines in each selected file - 1,
I would like to take just the count of latest file based on timestamp and previous timestamp file count .
a) Compare both counts ( if latest file >= old File --> just assign FLAG=SUCCESS
b) Compare both counts (if latest file < 10% of old File --> just assign FLAG=SUCCESS
c) Compare both counts (if latest file < 0 --> just assign FLAG=FAIL
2.all of the files you want to process can be selected by the filename matching pattern /var/tmp/*/*.csv,
yes , file pattern will be filename_timestamp ( exam ARCH_20171202.csv)
Lets use only one path /var/tmp/
3.all filenames end with an eight digit date string in the format YYYYMMDD followed by the string .csv, and
yes
4.within each directory under /var/tmp, the string before the date string is a constant?
yes
5.Do you want the line count from each selected file in a directory or do you want the sum of the line counts from the selected files in all of the directories containing *.csv files?
Lets have only file counts . use only one path /var/tmp/
I would like to use python instead of unix/perl . Using windows 7.
let me know for any questions
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I have delimited file(|).
Sample data:
1|name|50009|DS24|0|12
2|name|30009|DS24|0|13
3|name|20409|DS24|0|14
4|name|20009|DS24|0|15
5|name|10009|DS24|0|16
I want to load this data into a oracle table (update and insert)
Please help me the commands and also... (1 Reply)
Discussion started by: unihp1
1 Replies
2. Shell Programming and Scripting
Hi All,
I want to connect two tables in DB2 using shell script and then compare the contents of two tables field by field. Could any one please help me in connecting database tables using Unix and retriving data from the same.
Thanks,
Durwas (0 Replies)
Discussion started by: dtidke
0 Replies
3. UNIX for Dummies Questions & Answers
need some advice on the following situation.
I have a DB2 table which has a varchar Column. This varchar column can have special characters like ©, ®, ™ .
When I extract from this table to a sequential file for this varchar column I am only able to get © and ® .
To Get the ™... (1 Reply)
Discussion started by: cosec
1 Replies
4. Shell Programming and Scripting
Hi
I need help on this. Its very urgent for me.. please try to help me out..
I have data in tables in DB2 database. I would like to export the data from DB2 tables into a text file, which has to be space delimited. so that I can carry out awk, grep operations on that file. I tried to export... (2 Replies)
Discussion started by: ss3944
2 Replies
5. Shell Programming and Scripting
Hi
I am having three oracle databases running in three different machine. their ip address is different. from one of the DB am able to access both the databases.(means am able to select values and insert values in to tables individually.)
I need to fetch some data from DB1 table(say DB1 ip is... (2 Replies)
Discussion started by: aemunathan
2 Replies
6. UNIX for Dummies Questions & Answers
hi,
I need to create a bash shell script which picks up data from a text file and in the output file puts it into an html made table. I have to use sed and awk utilties to do this
the input text file will contain data in the format:
job name para1 para2 para3 para4 para4
1 ... (1 Reply)
Discussion started by: intern123
1 Replies
7. Shell Programming and Scripting
Hi ,
I Have following requirement:
DB2 Sql query to pass from a parameter file
for example, I would create a parameter file with (SELECT column 1, column 2 FROM Table name) then job would read it and create a file with the contents named table.txt
How to write/modify below ksh script to... (10 Replies)
Discussion started by: developer.dwh9
10 Replies
8. Shell Programming and Scripting
Hi All,
I want to insert STAT and ENDTIME values for each job in joblist into TBL_DAILY_STATUS table.
Eg: insert into tbl_daily_status values(STAT,ENDTIME);
Please help me on this.
#!/bin/ksh
joblist="com_abc_job com_abc_dot_job com_abc_seq com_abc_det"
for i in $joblist
do... (8 Replies)
Discussion started by: vichuelaa
8 Replies
9. Shell Programming and Scripting
Hello All Members,
I am new to this forum and to the shell scripting. I want to write a shell script to do the following:
Scenario: I have a pipe delimited .txt file with multiple fields in it. The very first row of the file contains the name of the column which resembles the name of the... (18 Replies)
Discussion started by: chetanojha
18 Replies
10. Programming
Dear Team
I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update )
Scenario
We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies
LEARN ABOUT DEBIAN
jifty::dbi::handle::sqlite
Jifty::DBI::Handle::SQLite(3pm) User Contributed Perl Documentation Jifty::DBI::Handle::SQLite(3pm)
NAME
Jifty::DBI::Handle::SQLite -- A SQLite specific Handle object
SYNOPSIS
DESCRIPTION
This module provides a subclass of Jifty::DBI::Handle that compensates for some of the idiosyncrasies of SQLite.
METHODS
database_version
Returns the version of the SQLite library which is used, e.g., "2.8.0". SQLite can only return short variant.
insert
Takes a table name as the first argument and assumes that the rest of the arguments are an array of key-value pairs to be inserted.
If the insert succeeds, returns the id of the insert, otherwise, returns a Class::ReturnValue object with the error reported.
case_sensitive
Returns 1, since SQLite's searches are case sensitive by default. Note, however, SQLite's "like" operator is case insensitive.
distinct_count STATEMENTREF
takes an incomplete SQL SELECT statement and massages it to return a DISTINCT result count
rename_column ( table => $table, column => $old_column, to => $new_column )
rename column
AUTHOR
Jesse Vincent, jesse@fsck.com
SEE ALSO
perl(1), Jifty::DBI
perl v5.14.2 2010-09-21 Jifty::DBI::Handle::SQLite(3pm)