Command to create and update csv file

Hi,

I need to create a csv file to store oracle query output. This report need to be created on hourly basis. The csv file report format as "Report_22_Sep_09_13IST.csv". I have the oracle query. Now i need to create and move the oracle query output to the report row by row starting from 3rd row. Could you please suggest the solution.

Thanks

Hi, Sekar1
I'm not an sql-expert. But probably you may find my hints useful
1) To generate the necessary filename you can use shell's date command, e.g.
a script

#!/usr/bin/env bash

FILENAME="Report_$(date +%d_%b_%g_%:::z%Z).csv"

touch $FILENAME

It will create files named Report_22_Sep_09_+03EEST.csv every time it is run. (The date certainly changes).

2) To run this script every hour you may use following

crontab -u your_username -e

and then edit your crontab by adding the following line:

* */1 * * * the_name_of_the_above_script

I hope I could help

Thanks a lot.. i will append the code and post my results.
:):):):slight_smile:

Hi,
Instead of IST, how can i make to print BST?
Please guide me
Thanks

Just to make sure that I understood you well. The system time on your computer is IST (Indian Standard Time), but you want to put date which corresponds to BST (British Standard Time). Did you want this?

Hi,

I got the answer. The above command itself works well :):slight_smile:
Thanks

You are welcome :slight_smile: