in reply to Mixed Data

If all you have is ASCII data with binary zeros, you might try just stripping out anything that isn't printable ASCII. Something like this might work.
while($line = <INFILE>) { $line =~ s{[^ -~]}{}g; # [^ -~] matches non printable ASCII chars print "$line\n"; # your new lines are gone after the above }

Just a thought...

Replies are listed 'Best First'.
Re: Re: Mixed Data
by krazken (Scribe) on Nov 09, 2001 at 09:59 UTC
    Someone else suggested...
    while (<>) { print join ' ',split /\x00/; }
    And this does remove the binary zeros from inside of the records.
      Someone else suggested...

      That was me, but you've added a space to the join. If you want to substitute space for null, tr/\000/ /; should work (tr/// wants octal).

      In any case, there is no reason s/\x00//g; wouldn't work if split on that regex does. How about posting some more of your code so we can see what the problem really is?

      After Compline,
      Zaxo