Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thank you very much for all the replies.To be more clear, now i am working on the below line of code to get the output.I am trying to write some if condition here so that SGWa-i is renamed to SGWa-i_LOWCASE and SGWA-I is renamed to SGWA-I_UPCASE.Sample data is provided below,Earlier i provided the data file with values but here i am providing the basic sketch file which is supposed to be referred

Sample data

sgw sketch sgwpts1 format EMS,SGW1,%date%,%time%,%sgw-vpnname%,%sgw-vp +nid%,%sgw-servname%,%sgw-servid% sgw sketch sgwptsh format EMS,SGWh,%date%,%time%,%sgw-vpnname%,%sgw-vp +nid%,%sgw-servname%,%sgw-servid% sgw sketch sgwptsi format EMS,SGWi,%date%,%time%,%sgw-vpnname%,%sgw-vp +nid%,%sgw-servname%,%sgw-servid% sgw sketch, sgwptsH format, EMS,SGWH,%date%,%time%,%sgw-vpnname%,%sgw- +vpnid%,%sgw-servname%,%sgw-servid% sgw sketch sgwptsI format EMS,SGWI,%date%,%time%,%sgw-vpnname%,%sgw-vp +nid%,%sgw-servname%,%sgw-servid%
Lines of code i am writing
sub load_sketch { my ($sketch_file) = @_; my %all_sketches = (); open(DAT, $sketch_file) || die("Could not open file $sketch_file!" +); my @lines = <DAT>; close(DAT); foreach (@lines) { s/[\r\n\s%]+//g; my @all_columns = split(',', $_); $all_sketches{ uc($all_columns[1]).'STAT' } = [ @all_columns ] +; # Output file will have SGWSTAT in its name } return %all_sketches; } 1; # tells perl that the package is ready to run
Please help me in the above code on how to rename or please suggest if there are better ways to handle it here

In reply to Re^4: Case insensitive string comparison by DAN0207
in thread Case insensitive string comparison by DAN0207

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-19 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found