Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1326
  • Last Modified:

script perl for generate oracle tnsnames.ora in csv file

Hello,

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

Thanks

Regards
0
bibi92
Asked:
bibi92
1 Solution
 
ZShaverCommented:
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
 
slightwv (䄆 Netminder) Commented:
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
 
DavidSenior Oracle Database AdministratorCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bibi92Author Commented:
Hello,

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

Thanks

bibi
0
 
slightwv (䄆 Netminder) Commented:
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
 
bibi92Author Commented:
Hello,
Are you wanting to take a CSV file and create a tnsnames.ora file using Perl --> yes.

Thanks a lot

Regards

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

Please provide sample input.
0
 
bibi92Author Commented:
alias = (ADDRESS = (PROTOCOL = TCP)(HOST = server)(PORT = 101)) ---> tnsnames.ora

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

Thanks

bibi
0
 
slightwv (䄆 Netminder) Commented:
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now