Hi have you tried:- od -c <filename> Laurence At 20:32 25/06/03 +0200 you scribbled:
On Wed, Jun 25, 2003 at 10:35:42AM -0700, David Driscoll wrote:
Hi all, I'm trying to work with text files that have mixed hard hyphens (ascii decimal 45) and soft hyphens (ascii decimal 255) and I need something that will let me distinguish between the two. hp-ux has a utility called vis that does just what I need-type "vis <filename>" and it returns text with everything above 7 bit ascii encoded as \(decimal number). Is there an equivalent in SUSE? I've looked and can't find anything. Or any other suggestions?
I'm not entirely sure of myself here... But if I've understood your question correctly, then this might be somewhere along what you're looking for.
(Disclaimer; "No, I don't pretend to know what I'm doing!" ;)
#!/usr/bin/perl open FILE, "<$ARGV[0]" or die "File does not exist\n"; @FILE=(<FILE>); foreach $line (@FILE) { @uni = unpack("C*", $line); while ($char = shift(@uni)) { if ($char <= "127") { push @back, (pack("C*", $char)); } else { push @back, ("\\$char"); } } } print @back; print "\nÆØÅ\n";
When I run it on itself, the last line of the script comes out as;
print "\n\198\216\197\n";
Is this useful?
HTH Jon Clausen -- If we can't be free, at least we can be cheap!
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Laurence ** if you want to know what the program really does, look at the code ** laurence@orchards.org.uk This Mail should NOT have an attachment, if it does it may have been created by a VIRUS DO NOT OPEN IT!!!