P
Patrick Flaherty
Hi,
When I copy a text file from VMS to Windows (via PATHworks) there are often
(depending on the length of the file) trailing garbage characters. I've
determined these to be byte value x1a (that it, hex 1a).
I can delete these from a single file with:
perl -p0777 -i.bu -e 's/\x1a+$//g' use.lis
What happens when I copy over a whole bunch of *.lis, many of which might have
this problem?
I can loop over all these with:
@list = glob("*.lis");
foreach $name (@list) {
print $name . "\n";
}
That prints all the names out. But what I want to do is delete the garbage
chars from each file in turn.
This doesn't work (not surprising):
@list = glob("*.lis");
foreach $name (@list) {
s/\x1a+$//g $name;
}
Doubtless I'm doing something daft here. Hope someone can help me out.
pat
When I copy a text file from VMS to Windows (via PATHworks) there are often
(depending on the length of the file) trailing garbage characters. I've
determined these to be byte value x1a (that it, hex 1a).
I can delete these from a single file with:
perl -p0777 -i.bu -e 's/\x1a+$//g' use.lis
What happens when I copy over a whole bunch of *.lis, many of which might have
this problem?
I can loop over all these with:
@list = glob("*.lis");
foreach $name (@list) {
print $name . "\n";
}
That prints all the names out. But what I want to do is delete the garbage
chars from each file in turn.
This doesn't work (not surprising):
@list = glob("*.lis");
foreach $name (@list) {
s/\x1a+$//g $name;
}
Doubtless I'm doing something daft here. Hope someone can help me out.
pat