Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. duncdude

    perl: remove non-english sentence

    #!/usr/bin/perl -w use strict; use warnings; my %english = (); open ( DICTIONARY, '<', '/usr/share/dict/words' ); while ( <DICTIONARY> ) { $_ = lc $_; print; chomp; $english{ $_ } = 1; } close DICTIONARY; while ( <DATA> ) { $_ = lc $_; my $finds = 0; my @split_up =...
  2. duncdude

    Distance between xyz coordinates in pdb files

    coloring in regex shows (...) mapping to $6, $7 * $8 respectively #!/usr/bin/perl $num = 0; s/^ATOM__(.....).(.....).(....).(...)..(....)....(........)(........)(........)/$arrayx[ $num ] = $6; $arrayy[ $num ] = $7; $arrayz[ $num++ ] = $8/e while ( <DATA> ); foreach( $i = 0; $i < $num; $i++...
  3. duncdude

    Distance between xyz coordinates in pdb files

    #!/usr/bin/perl $num = 0; while ( <DATA> ) { # Find x, y, z coordinates and store in separate arrays if ( $_ =~ s/^ATOM__(.....).(.....).(....).(...)..(....)....(........)(........)(........)/$arrayx[ $num ] = $6; $arrayy[ $num ] = $7; $arrayz[ $num ] = $8/e ) { print "num is...
  4. duncdude

    scripting - copy to clipboard

    Hi I just wondered if anyone knows how to copy to the clipboard with InDesign scripting? Surely this must be possible - I just can't seem to find any way of doing this Kind regards Duncan Kind Regards Duncan
  5. duncdude

    InDesign javascript scripting

    Thank you Eugene This is what i have managed so far: var mydoc = app.activeDocument; var concat = "Duncan => InDesign / javascript automation project\n"; for( var p = 0; p < mydoc.pages.length; p++ ) { for (var j=0; j < mydoc.pages[p].textFrames.length; j++) { var X = parseInt(...
  6. duncdude

    InDesign javascript scripting

    Hi I wondered whether anyone could help me do the following: I need to write a Javascript script to iterate through all the text frames of all the pages of the active document i.e. for (p=0; p < app.activeDocument.pages; p++) { for (t=0; t < app.activeDocument.pages.textFrames) {...
  7. duncdude

    simple regex ...

    This will build a hash of the Prinergy Updates - and they will store the dates they were installed #!/usr/bin/perl s/([A-Z]{1}[a-z]{2} [A-Z]{1}[a-z]{2} \d+ \d+:\d+:\d+ \d{4}).*{(.*)}/$PRINVER{$2} = $1/e while <DATA>; while (($key, $value) = each %PRINVER) { print "$key => $value\n"; }...
  8. duncdude

    Sorting/comparing like filenames

    How about this? #!/usr/bin/perl s/^([^-]+)-(\d+)/$mostRecent{$1} = $2 if $2 > $mostRecent{$1}/e while <DATA>; print "$key => $value\n" while (($key, $value) = each %mostRecent); __DATA__ xxxxxxxx-01.ext xxxxxxxx-03.ext yyyyyyyy-23.ext yyyyyyyy-24.ext aaaaaaaa-01.ext aaaaaaaa-09.ext...
  9. duncdude

    arrays and variables with pattern matching

    something like this? #!/usr/bin/perl undef $/; $_ = <DATA>; $/ = "\n"; @keywords = qw( cat dog chicken ); foreach $keyword (@keywords) { s/\b($keyword)\b/$found{$1}++/eg; } while (($key, $value) = each %found) { print "$key => $value\n"; } __DATA__ blah blah blah blah cat blah blah...
  10. duncdude

    Reducing CPU impact of regexp matching

    couldn't you just run nicely? nice 19 yourscript Kind Regards Duncan
  11. duncdude

    extract part of a htmls contents and display/save txt file

    sorry. bit drunk. m|<code>(.*)</code>|; Kind Regards Duncan
  12. duncdude

    extract part of a htmls contents and display/save txt file

    yep maybe m/(<body>(.*)</body>)/ ? Kind Regards Duncan
  13. duncdude

    quark omits eps files when printing or distilling

    or it could be that your EPS file is actually a DCS file... Kind Regards Duncan
  14. duncdude

    Updating catalog prices from a database w/o a 3rd party software

    No problem Thanks for your reply Good luck! Kind Regards Duncan
  15. duncdude

    method post to multiple cgi

    use <div>'s with css ? Kind Regards Duncan
  16. duncdude

    Capture Text

    #!/usr/bin/perl while (<DATA>) { chomp; ($key, $value) = split(/=/); $uname = $value if $key eq "User name"; } print "uname => $uname\n"; __DATA__ blah blah blah User name=jriggs blah blah Kind Regards Duncan
  17. duncdude

    regex to grab file extension

    thank you dude! Kind Regards Duncan
  18. duncdude

    Text and image moving

    Cool. :-) Kind Regards Duncan
  19. duncdude

    Updating catalog prices from a database w/o a 3rd party software

    Can you not just create the database in FileMaker Pro (for example), create calculated fields that wrap XPress Tags around the fields, then export the data as an ASCII file. Then import into Quark and all the formatting should be done. This way it is simple to make changes to the original data -...
  20. duncdude

    regex to grab file extension

    #!/usr/bin/perl while (<DATA>) { print "$1\n" if m/((\.tar)?\.[a-z]+)$/; } __DATA__ somefile.txt some.file.txt somefile..text somefile.tar.gz somefile Kind Regards Duncan

Part and Inventory Search

Back
Top