in reply to perl file processing

Start with creating loops: readdir

Once you have the ARC files, just open, read them and grep on your criteria open

Then, move the file by renaming it (basically, you change the directory) rename

Why not in shell?

for ARC in `grep -l 'TCO' *.ARC`; do PDF=`basename -s ARC "$ARC"`PDF; if [ -f "$PDF" ]; then echo "Both $ARC and $PDF exist, do the move"; fi; done

Replies are listed 'Best First'.
Re^2: perl file processing
by GrandFather (Saint) on Mar 11, 2016 at 01:20 UTC

    I just tried that on my windows computer and it didn't work at all 8-D

    A nice thing about Perl is that to a large extent ash/bash/csh/dash/ksh/.../zsh type activities written in Perl have a much better chance of working across systems.

    Update: Zoidberg may give the best of both worlds of course.

    Premature optimization is the root of all job security