Re: Replacing characters in file
- From: Anony-mouse <anony-mouse@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Mar 2007 12:40:14 +1200
In article <%7iOh.1641$Rp2.877@trndny04>, "Jürgen Exner"
<jurgenex@xxxxxxxxxxx> wrote:
Anony-mouse wrote:
In article <Z9aOh.3620$J21.675@trndny03>, "Jürgen Exner"
If on the other hand you don't have a text file, then maybe it is
time to stop treating it as a text file but start handling it as a
binary file instead.
It's not a text file. As I said it's a .DAT file
Whatever that is supposed to mean.
A file name ending of .DAT doesn't imply anything as to the content of the
file.
Although not necessarily true, it does imply that it's not a simple
..TXT file.
that contains control
characters, including EOF ones. :o\
Well, if it is not a text file but a binary file, then it isn't very
meaningful to talk about characters.
It would have been much less confusing if you had said "I have a two-byte
sequence"01 5F" (denoted in hex) and like to replace it with "01 5C".
Symantics (or pendaticism, whichever you prefer). It still means the
same thing and some people seem to have understood what I was saying,
while others simply want to get picky about terminology.
I still don't understand why a simply
s/\x01\x5F/\x01\x5C/g
shouldn't work.
It doesn't work in SED because SED aborts when it hits the first EOF
character and so doesn't complete the file.
In the version of Perl I've been using it simply does nothing - I get a
completely empty result file. I'll have to wait until I finish
downloading Active Perl and see what happens there, but that may be too
big in filesize for my needs.
_
_/ \___
Anony-mouse says o_/O _/ \
"Eek-eek-eek!" \__/_|_/_|\____/
.
- Follow-Ups:
- Re: Replacing characters in file
- From: Jürgen Exner
- Re: Replacing characters in file
- References:
- Replacing characters in file
- From: Anony-mouse
- Re: Replacing characters in file
- From: Dr.Ruud
- Re: Replacing characters in file
- From: Anony-mouse
- Re: Replacing characters in file
- From: Dr.Ruud
- Re: Replacing characters in file
- From: Anony-mouse
- Re: Replacing characters in file
- From: John W. Krahn
- Re: Replacing characters in file
- From: Anony-mouse
- Re: Replacing characters in file
- From: Jürgen Exner
- Re: Replacing characters in file
- From: Anony-mouse
- Re: Replacing characters in file
- From: Jürgen Exner
- Replacing characters in file
- Prev by Date: Re: Replacing characters in file
- Next by Date: Re: Replacing characters in file
- Previous by thread: Re: Replacing characters in file
- Next by thread: Re: Replacing characters in file
- Index(es):
Relevant Pages
|