Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Text File Manipulation

by roboticus (Chancellor)
on Jan 14, 2020 at 14:56 UTC ( #11111407=note: print w/replies, xml ) Need Help??


in reply to Re^2: Text File Manipulation
in thread Text File Manipulation

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11111407]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2020-10-28 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (259 votes). Check out past polls.

    Notices?