i have a query: i want to read a file which contains:
2005/02/21 16:56:54.301: 111 PS (200, 10) sent <log instrument="FXA.ROSS" name="FXA.COSS.PAH.URR"><gid_id>1434025</gid_id><submit_id>22</submit_id><taker_name>shannop2</taker_name><taker_group_name>SupportClients/SupportUsers</taker_group_name><taker_account>Demo
2005/02/21 16:56:55.596: 111 PS (200, 10) sent <log instrument="FXA.ROSS" name="FXA.ROSS.PUR.URR"><gid_id>1534025</gid_id><submit_id>22</submit_id><taker_name>shannop2</taker_name><taker_group_name>SupportClients/SupportUsers</taker_group_name><taker_account>Demo
Now i want to grep just the timestamp (ie 16:56:54.301) & the gid_id (ie 1434025) in the first line & so on for all lines. Then insert this into a oracle database.
what i have done is i use the cut command to first cut the timestamp on each line & write to a file , then do the same with the gid_id. Finally paste the two files. It looks like this.
file1 : jo.txt
16:56:54.301
16:56:55.596
file2: jo1.txt
1434025
1534025
After paste, file3: jo3.txt
16:56:54.301 1434025
16:56:55.596 1534025
Question 1: is there an easeier way to do this?
Question 2: i want to read file3 (ie jo3.txt) & insert the contents into an oracle table
To do this, should i count the no. of lines in file3 (ie jo3.txt) using wc -l & then using a for loop connect to db using the sql -s user/passwd@server<<++>/dev/null & use the insert command?
would be great if i could get suggestions on this...plz
Hi guys, i'm being a bt dumn here but will be great if you can help!
I'm writing this script(named as Jo.sh), now i'm wondering if i need to include the ctl file within the unix script or should the ctl file be called from within the script file. Here are the details:
Should the script look like this:
#jo.sh (this is the script file on my unix machine)
nice grep sent pac.txt |nice grep 'log ins'|nice grep spot_markup|cut -c12-23>jo.txt
nice grep sent pac.txt |nice grep 'log ins'|nice grep spot_markup|cut -c107-113>jo1.txt