Solved

script perl for generate oracle tnsnames.ora in csv file

Posted on 2012-04-03
9
1,189 Views
Last Modified: 2012-08-14
Hello,

I search a script perl for generate oracle tnsnames.ora in csv file.

Thanks

Regards
0
Comment
Question by:bibi92
9 Comments
 
LVL 7

Expert Comment

by:ZShaver
Comment Utility
The grammar and poor word placements in this question makes it impossible to determine what you are trying to do, sorry.

From my understanding, and it took me several minutes to piece this together, you want to search a perl script to determine how it generates oracle's tnsnames.org from a CSV file?
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
I agree.  Can you explain what you are wanting?

A perl script, tnsnames.ora file and a CSV file really have nothing to do with one another.
0
 
LVL 23

Expert Comment

by:David
Comment Utility
Also agree.  If the tnsnames syntax is throwing you, check out http://www.orafaq.com/wiki/Tnsnames.ora -- one of many sources, and simpler than some.
0
 

Author Comment

by:bibi92
Comment Utility
Hello,

I search to format tnsnames.ora in a csv file with a perl script.

Thanks

bibi
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
That explaination does not help.

Are you wanting to parse the tnsnames.ora file and create some CSV using Perl?
Are you wanting to take a CSV file and create a tnsnames.ora file using Perl?

Are you wanting to do something completely different?

Maybe some sample data and expected results would help us understand what you want to do.
0
 

Author Comment

by:bibi92
Comment Utility
Hello,
Are you wanting to take a CSV file and create a tnsnames.ora file using Perl --> yes.

Thanks a lot

Regards

bibi
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
>>Are you wanting to take a CSV file and create a tnsnames.ora file using Perl --> yes.

Please provide sample input.
0
 

Author Comment

by:bibi92
Comment Utility
alias = (ADDRESS = (PROTOCOL = TCP)(HOST = server)(PORT = 101)) ---> tnsnames.ora

alias;server;port ----> csv file

Thanks

bibi
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
Comment Utility
There are a TON of scripts out there on parsing a CSV file using Perl (even though your file is semi-colon delimited not comma).

The example below uses SPLIT:
http://perl.about.com/od/filesystem/a/perl_parse_tabs.htm

I don't have Perl to test it but it should go something like:

 open (FILE, 'myfile.csv');
 while (<FILE>) {
 chomp;
 ($alias, $server, $port) = split("\t");
 print "$alias = (ADDRESS = (PROTOCOL = TCP)(HOST = $server)(PORT = $port))
 }
 close (FILE);
 exit;
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to recover a database from a user managed backup

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now