in reply to Variable assignments flat file

Show us some sample data. Show us what you've tried. Show us what you want out and what you get from your current code.

See I know what I mean. Why don't you? for hints about how to include sample data in your sample script.

Premature optimization is the root of all job security

Replies are listed 'Best First'.
Re^2: Variable assignments flat file
by sfrisch@mt.gov (Initiate) on Nov 04, 2015 at 14:32 UTC
    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))) # } }

      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