Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

batch expand Windows compressed printer driver files

by grinder (Bishop)
on Nov 18, 2004 at 15:54 UTC ( #408792=snippet: print w/replies, xml ) Need Help??
Description:

I had a directory full of compressed printer driver files for Windows. The file abc.de_ is expanded into abc.def (and the fact that _ is replaced by f is governed by a file with an .INF exension). Normally this is all dealt with behind the scenes automatically, but I had to do it manually.

The following snippet will look for lines that contain the abc.de_/abc.def mapping and expands those files.

Additional error checking is left as an exercise to the reader :)

perl -nle "/^([^.]+\.[A-Z]{3}),([^.]+\.[A-Z]{2}_)$/ and system qq{expand $2 $1}" HPBF3510.inf
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2023-12-03 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (20 votes). Check out past polls.

    Notices?