in reply to Re: Variable assignments flat file
in thread Variable assignments flat file

open FILE, 'c:\ldap_entries.txt'; while(<FILE>){ chomp; s/ //g; s/:/ /g; s/\(/ /g; s/\)/ /g; s/=/ /g; if(/orclNetDescString/){ $AA = $_; #print "$AA"; } if(/PORT/){ $AA1 = $_; } if(/orclSid/){ $AA2 = $_; # print "\n$AA$AA1$AA2\n"; $AA3 = "\n$AA$AA1$AA2"; push @LINE,$AA3; $server = $LINE[6]; $port1 = $LINE[8]; # Iwant to create TNSNames.txt based on a formatt # #alstrn = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = ( +PROTOCOL = TCP)(HOST = 10.194.146.184)(PORT = 1542))) (CONNECT_DATA = + (SERVICE_NAME = alstrn))) #outt put to file $SID = (DESCRIPTION = (ADDRESS_LIST = + (ADDRESS = (PROTOCOL = TCP)(HOST = $server)(PORT = $port1))) (CONN +ECT_DATA = (SERVICE_NAME = $SID))) # } }

Replies are listed 'Best First'.
Re^3: Variable assignments flat file
by stevieb (Canon) on Nov 04, 2015 at 14:48 UTC

    Please always wrap your code and data within <code></code> tags per my message. To further, since this information is directly related to your original post, it would be best if you edited your original question to include it, so that new readers don't have to scroll the entire thread to find it. See How do I change/delete my post?.

      ok thanks