I
ifiaz
I have a .csv file that looks like this with 309 rows that has a single
day's data.
|<----------------------- 103 Columns (FIXED)----------------->|
HSTATION_CD,HAGENT_NUM,AIRLINE_CD,...,FDEPT_ACTUAL_DT,LOADED_OOG,XLOADED_OOG
HKG,HAS,CX,...,10-JAN-2005 01:40:42,11,0
HKG,HAS,CX,...,10-JAN-2005 01:40:42,11,0
HKG,HAS,CX,...,10-JAN-2005 01:40:42,11,0
HKG,HAS,CX,...,10-JAN-2005 01:40:42,11,0
I need to do the following:
1) Generate report based on sums of the whole column, count of some of
the columns, etc. All the data I require are an aggregate of some of
the columns.
2) Everyday, I need to print the report together with a custom summary
written by me on top of the imported data for that day.
3) I need to be able to retrieve the aggregate data for any day of the
year together with the summary.
The stored data table that I require is...
01/01/05, Sum Of Col1, Count Of Col2 That Equals "CX", Custom Summary
Event Typed Out, etc.
02/01/05, Sum Of Col1, Count Of Col2 That Equals "CX", Custom Summary
Event Typed Out, etc.
03/01/05, Sum Of Col1, Count Of Col2 That Equals "CX", Custom Summary
Event Typed Out, etc.
.....
and so on.
I need not require to store the LARGE raw data that I obtain from the
..csv but only the summary.
----
My failed attempts are:
Attempt 1:
I imported the whole .csv into a single table and it was too awkward to
manipulate the data. Also, I didn't know how I might go about storing
the data I require together with my custom comments in another table.
Attempt 2:
I used two tables. One that has two fields storing the ID and the 103
column names as values. Another table with 3 fields, that is linked to
the first table with the values as text (actually most of the data is
numbers, and times). I require to transpose the original data in order
to store it in the second table.
So, I tried to read the file line by line an insert into the table.
But, this is quite slow. Even, if I am successful in this, I didn't
know how to store the data I require with my custom comments in another
table.
I want to know whether my direction is right. How am I go about in
doing this?
Please give brief step by step instructions. Thanks for your time.
day's data.
|<----------------------- 103 Columns (FIXED)----------------->|
HSTATION_CD,HAGENT_NUM,AIRLINE_CD,...,FDEPT_ACTUAL_DT,LOADED_OOG,XLOADED_OOG
HKG,HAS,CX,...,10-JAN-2005 01:40:42,11,0
HKG,HAS,CX,...,10-JAN-2005 01:40:42,11,0
HKG,HAS,CX,...,10-JAN-2005 01:40:42,11,0
HKG,HAS,CX,...,10-JAN-2005 01:40:42,11,0
I need to do the following:
1) Generate report based on sums of the whole column, count of some of
the columns, etc. All the data I require are an aggregate of some of
the columns.
2) Everyday, I need to print the report together with a custom summary
written by me on top of the imported data for that day.
3) I need to be able to retrieve the aggregate data for any day of the
year together with the summary.
The stored data table that I require is...
01/01/05, Sum Of Col1, Count Of Col2 That Equals "CX", Custom Summary
Event Typed Out, etc.
02/01/05, Sum Of Col1, Count Of Col2 That Equals "CX", Custom Summary
Event Typed Out, etc.
03/01/05, Sum Of Col1, Count Of Col2 That Equals "CX", Custom Summary
Event Typed Out, etc.
.....
and so on.
I need not require to store the LARGE raw data that I obtain from the
..csv but only the summary.
----
My failed attempts are:
Attempt 1:
I imported the whole .csv into a single table and it was too awkward to
manipulate the data. Also, I didn't know how I might go about storing
the data I require together with my custom comments in another table.
Attempt 2:
I used two tables. One that has two fields storing the ID and the 103
column names as values. Another table with 3 fields, that is linked to
the first table with the values as text (actually most of the data is
numbers, and times). I require to transpose the original data in order
to store it in the second table.
So, I tried to read the file line by line an insert into the table.
But, this is quite slow. Even, if I am successful in this, I didn't
know how to store the data I require with my custom comments in another
table.
I want to know whether my direction is right. How am I go about in
doing this?
Please give brief step by step instructions. Thanks for your time.