Gary Montgomery wrote: > > > Hi all- > > A co-worker of mine needs to extract all the text (from their own > layers) from ~2000 Photoshop psd (binary) files > and preferably be able to replace the text latter (after being > translated). My perl skills have become rusty and even when I was > ontop > > of things, binary manipulations were not my strong point. I've tried > using binmode() on STDIN and I've used sysopen(BINDAT, "test1.psd", > O_RDWR | O_BINARY) || die "can't open test1.psd: $!"; Both of these > change nothing from if I treat the file as just a text file. When I do > a while(<>) {print;} > > I get the first few lines. I can even do matching on these first few > lines. But then I must be hitting something that looks like EOF to > perl. Any ideas, tips? > > I've been doing google searches and been searching cpan but have found > nothing useful yet. > > Thanks in advance, > -Gary I recommend to have a look to the Unix Reconstruction Project page. You have the strings command there, reimplemented in perl. (So, you can use it even if you are not running UNIX). It will give you the text strings inside a binary file. http://language.perl.com/ppt/src/strings/index.html You can see the code and adapt it to your necessities, Cheers, Jose -- Jose Quesada Jimenez [EMAIL PROTECTED] http://lsa.colorado.edu/~quesadaj http://geneura.ugr.es/~jose visitor researcher Institute of Cognitive Science University of Colorado (Boulder) Muenzinger psychology building Campus Box 344 Univeristy of colorado at Boulder Boulder, CO 80309-0344 Phone, work:303 492 4574 home:303 545 2082 _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users