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??

sabas--

Your code is frightening. You need to learn how to read code and understand what's happening inside it. Your code has three different places where you're creating the desired row of data (one which looks just fine) and then you're playing with temporary files in desperate attempts at trying to somehow get the data into the file you want.

It looks like it would work if you'd remove all the junk you don't really need. I was able to cut your code down into something that looks reasonable in less than 40 lines. I'd ordinarily make a long post describing some ways to improve your code, but I don't have the time to do it today. Instead I'll show you the line that looks like it would work (I changed @rows to $rows to eliminate a warning):

$rows[$submit_button] = $file_requesterName . $file_requesterEmail . $ +file_reqtype . $file_region . $file_Serial_Number . $file_aiws_OSS_IP +_pri . $file_aiws_OSS_IP_sec . $file_temp_SGW_IP_pri . $file_temp_SGW +_IP_sec . $file_bts_site_id . $file_req_date . $file_NOC_Update_req . + $file_OSS_enm . $file_category . $file_RNC_Name . $file_submission_ +status . $file_additionalnotes;

Since that line puts the data in the correct format into @rows, you can delete the code dealing with temporary files and just write the @rows data to the output file.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re^3: Text File Manipulation by roboticus
in thread Text File Manipulation by sabas

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 examining the Monastery: (7)
As of 2024-04-19 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found