learingperl01
MIS
Hello,
Wondering if someone could please point me in the right direction. I have a file like the one shown below which is separated by "---------" between filenames/paths. Now what I want to do is remove/delete each file minus the first entry after the "----------" I am not even sure how to go about starting that, don't need help with a full script just how to go about doing part of the code. I know I need to unlink each file but how to I tell perl to remove each file after "--------" and first file path. File contents shown below should help clear things up. Thanks for the help in advance. Please let me know if you guys need any more details.
Wondering if someone could please point me in the right direction. I have a file like the one shown below which is separated by "---------" between filenames/paths. Now what I want to do is remove/delete each file minus the first entry after the "----------" I am not even sure how to go about starting that, don't need help with a full script just how to go about doing part of the code. I know I need to unlink each file but how to I tell perl to remove each file after "--------" and first file path. File contents shown below should help clear things up. Thanks for the help in advance. Please let me know if you guys need any more details.
Code:
--------------------
/records/akr/00012.txt
/records/akz/001223.txt
/records/zzkr010112.txt
/records/updated/akz/001223.txt
---------------------
/records/xvf/3k33.txt
/records/arc/2231.txt
/records/updated/xvf/2k33.txt
So what I would like to do is unlink all files after the first entry which is preceded by ----------------
Script should unlink the following files
From the first section the following files should be unlinked
/records/akz/001223.txt
/records/zzkr010112.txt
/records/updated/akz/001223.txt
From the second section the following files should be unlinked
/records/arc/2231.txt
/records/updated/xvf/2k33.txt