Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Thanks for the reply ebm, but a bit of hacking about produced the following code. Looking at the file in a hex editor revealed that the paths are stored in plain text.

One of the benefits of our ad prod system is that everything Art wise would be prefaced by "AdArt". I would assume that you could just as easily write the regex below to look for ".eps .tif" etc...

Das Code:

#! /bin/perl -w ########################################################## # Get linked Art # Finds out what art a QXD is using ########################################################## $filename = $ARGV[0]; @quark_data = `strings $filename`; @usage = parseUsage(@quark_data); @usage = trim_path(@usage); printArr(@usage); sub trim_path { my @trimmed; for (@_) { $_ =~ /AdArt\:.*\.low/; push @trimmed, $&; } return @trimmed; } sub printArr { my $n = 0; foreach (@_) {print $n++.": $_\n"}; } sub parseUsage { my @winners; for (@_) { /AdArt/ && do {push @winners, $_;}; } return @winners; }

Das Output:

usage.pl 1234342 0: AdArt:EHO LOGO-TIFF.low 1: AdArt:EHO LOGO-TIFF.low 2: AdArt:Header_FOR_FILLER.tif.low 3: AdArt:long_fosterlogo.tiff.low 4: AdArt:3853_dove_homes_logo.eps.low 5: AdArt:CENTEX_LOGO_THE_BEST.EPS.low 6: AdArt:long_fosterlogo.tiff.low 7: AdArt:long_fosterlogo.tiff.low 8: AdArt:CENTEX_LOGO_THE_BEST.EPS.low 9: AdArt:Century21_Logo.tif.low 10: AdArt:Century21_Logo.tif.low 11: AdArt:V3853_edgewaterlogo.tif.low 12: AdArt:forestlakelogo.eps.low 13: AdArt:long_fosterlogo.tiff.low 14: AdArt:Forest Lake.eps.low 15: AdArt:thehighlandslogo.tif.low

I'm assuming that this would even work under windows provided you downloaded Gnu strings from the gnerds. Would probably make a nice module if I made it a bit less specific to my application.

Thanks!
Hammy


In reply to Re: Re: OT: Quark Xpress Which art is it using?? by HamNRye
in thread OT: Quark Xpress Which art is it using?? by HamNRye

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-29 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found