Sponsored Content
Full Discussion: txt file to oracle database
Top Forums Shell Programming and Scripting txt file to oracle database Post 65779 by jorhul on Wednesday 9th of March 2005 04:56:05 AM
Old 03-09-2005
Quote:
Originally Posted by ZealeS
Code:
bash-2.05$ cat filename
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

bash-2.05$ awk '/^20/{a=index($0,"gid_id>");b=index($0,"</gid_id");print substr($2,0,length($2)-1)"\t"substr($0, a+7, b-a-7);}' filename
16:56:54.301    1434025
16:56:55.596    1534025
bash-2.05$

Hi , I tried that piece of code it gave me the following error:

awk: record `2005/02/21 16:56:45....' too long
record number 1

cheers,
Jo
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to extract the data from database (oracle) and send the output as an .xls file?

Hi, How to extract the data from Oracle database and sent the output data to mails using mailx command with .xls attachement? Here i know how to connect the database using unix shell script and how to use the mailx command in UNIX script But i don't know how to use the .xls format file (i... (1 Reply)
Discussion started by: psiva_arul
1 Replies

2. Shell Programming and Scripting

Find similar entry in a .txt file acting as a database.

May i know how do i go along finding similar entry in a .txt file, which is used a as a "database" and post and error saying the entry existed when we key in the entry. ---------- Post updated at 05:18 PM ---------- Previous update was at 05:16 PM ---------- i mean post an error saying the... (5 Replies)
Discussion started by: santonio
5 Replies

3. Solaris

Can't create database after Oracle Database installation

I installed Oracle 10 software on Solaris 11 Express, everything was fine execpt I can't create database using dbca.rsp file. I populated file with following options. OPERATION_TYPE = "createDatabase" GDBNAME = "solaris_user.domain.com" SID = "solaris_user" TEMPLATENAME = "General... (0 Replies)
Discussion started by: solaris_user
0 Replies

4. Shell Programming and Scripting

Using csh / awk / sed to compare database sizes in a txt file

Hello, I have an output file showing database sizes across the 3 environments that I use (LIVE, TEST & DEVELOPMENT). I am trying to write a script that lets me know if the size of a db on one environment is different to its corresponding db on the other environments. Here is an example... (4 Replies)
Discussion started by: stevie_g
4 Replies

5. Shell Programming and Scripting

shellscript to read data from txt file and import to oracle db

Hi all, Help needed urgently. I am currently writing a shellscript to read data/record from a flat file (.txt) file, and import/upload the data to oracle database. The script is working fine, but it takes too long time (for 18000 records, it takes around 90 mins). I guess it takes so long... (1 Reply)
Discussion started by: robot_mas
1 Replies

6. UNIX and Linux Applications

Identify a specific environment Oracle variable to connect a remote Oracle database ?

Good evening I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus. I tried to find out the user/passwd and service name by env variable and all Ive got is this: ORACLE_SID_REPCOL=SCL_REPCOL ORACLE_SID=xmeta ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies
Ace::Iterator(3pm)					User Contributed Perl Documentation					Ace::Iterator(3pm)

NAME
Ace::Iterator - Iterate Across an ACEDB Query SYNOPSIS
use Ace; $db = Ace->connect(-host => 'beta.crbm.cnrs-mop.fr', -port => 20000100); $i = $db->fetch_many(Sequence=>'*'); # fetch a cursor while ($obj = $i->next) { print $obj->asTable; } DESCRIPTION
The Ace::Iterator class implements a persistent query on an Ace database. You can create multiple simultaneous queries and retrieve objects from each one independently of the others. This is useful when a query is expected to return more objects than can easily fit into memory. The iterator is essentially a database "cursor." new() Method $iterator = Ace::Iterator->new(-db => $db, -query => $query, -filled => $filled, -chunksize => $chunksize); An Ace::Iterator is returned by the Ace accessor's object's fetch_many() method. You usually will not have cause to call the new() method directly. If you do so, the parameters are as follows: -db The Ace database accessor object to use. -query A query, written in Ace query language, to pass to the database. This query should return a list of objects. -filled If true, then retrieve complete objects from the database, rather than empty object stubs. Retrieving filled objects uses more memory and network bandwidth than retrieving unfilled objects, but it's recommended if you know in advance that you will be accessing most or all of the objects' fields, for example, for the purposes of displaying the objects. -chunksize The iterator will fetch objects from the database in chunks controlled by this argument. The default is 40. You may want to tune the chunksize to optimize the retrieval for your application. next() method $object = $iterator->next; This method retrieves the next object from the query, performing whatever database accesses it needs. After the last object has been fetched, the next() will return undef. Usually you will call next() inside a loop like this: while (my $object = $iterator->next) { # do something with $object } Because of the way that object caching works, next() will be most efficient if you are only looping over one iterator at a time. Although parallel access will work correctly, it will be less efficient than serial access. If possible, avoid this type of code: my $iterator1 = $db->fetch_many(-query=>$query1); my $iterator2 = $db->fetch_many(-query=>$query2); do { my $object1 = $iterator1->next; my $object2 = $iterator2->next; } while $object1 && $object2; SEE ALSO
Ace, Ace::Model, Ace::Object AUTHOR
Lincoln Stein <lstein@cshl.org> with extensive help from Jean Thierry-Mieg <mieg@kaa.crbm.cnrs-mop.fr> Copyright (c) 1997-1998 Cold Spring Harbor Laboratory This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty. perl v5.14.2 2000-09-03 Ace::Iterator(3pm)
All times are GMT -4. The time now is 02:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy