Hi All,
I'm new to perl and still learning.
I'm having few files in a unix server which are actually in un-readable format. Those files are generated by some COBOL programs and those files are of RECORD TYPE 31.
Normally we used to give below command manually to read these files in the Unix server.
> irs "filename"
Then it will open vi editor and will display the file in readable format (TXT format). Then we are passing ":q!" to come out of this editor. After this a text file will be generated in the directory which is what we need.
Now I want to implement these steps using perl script. I tried using system() and backticks`` to do this, but the perl script is waiting for the quitr command to get out of that vi editor. Please help me in how to pass those commands through perl script.
When I execute this script, it is opening vi editor and I can able to see the readable format of the file, but I should give quit command manually to come out of that, but I need that to be done through script.
Let me know if any details required from my end.
I'm new to perl and still learning.
I'm having few files in a unix server which are actually in un-readable format. Those files are generated by some COBOL programs and those files are of RECORD TYPE 31.
Normally we used to give below command manually to read these files in the Unix server.
> irs "filename"
Then it will open vi editor and will display the file in readable format (TXT format). Then we are passing ":q!" to come out of this editor. After this a text file will be generated in the directory which is what we need.
Now I want to implement these steps using perl script. I tried using system() and backticks`` to do this, but the perl script is waiting for the quitr command to get out of that vi editor. Please help me in how to pass those commands through perl script.
Code:
#!/usr/local/bin/perl
use File::Copy;
@outarray = ();
@outarray = `ls \*.INT.\*`;
print "@outarray \n";
foreach $outint (@outarray){
system("irs $outint");
}
exit;
Let me know if any details required from my end.
Comment