--thanks for the reply:

--at this point, i'm still trying to figure out
--how to find NEL.  the ASCII chart says the following:

[snip]
DEC   HEX   OCT   EDT    TPU   CHAR DESCRIPTION

10   00A   012   <LF>   L/F       CTRL-J   LF    line feed

13   00D   015   <CR>   C/R       CTRL-M   CR    carriage return

...
...
...
DEC Multinational Character Set Extension of the ASCII character set

DEC   HEX   OCT   EDT    TPU   CHAR DESCRIPTION

133   085   205   <NEL>   ?        NEL   next line

[/snip]


--i thought it was newline, too, but this seems to just say 'next line'.
--i had imagined that control-m, control-j is what created this, but,
--now i'm not so sure.

--as i've said, i can do a sed to remove CF and LF, but i'm thinking
--that NEL is just the end of the line and i can't remove it ... or maybe
--i can't replace it ... *shrug* ...

--i don't know how to isolate characters like this in perl, so, i
--don't have much of a script to show you.  i was looking
--at http://groups.google.com  and it appears someone just said:

[snip]

#!/usr/bin/perl -pi

chop;
print;

[/snip]

--but i think i'm doing that wrong (actually, i *know* i am) ....

--so, that's where i am now.

--any suggestions?

--thanks!

-X



-----Original Message-----
From: Rob Dixon [mailto:[EMAIL PROTECTED]]


I think we may need to see your Perl code Shaunn. I've never heard of a NEL
character but that may be my ignorance; do you mean newline? How do you know
the control characters aren't being removed by what you've done?

chomp() will remove the last character from a string if it is the input
record separator character $/, normally '\n'. chop() will remove the last
character whatever it is, and so will do the job as long as you're sure the
string ends with a charatcer that you don't want.

Let us know,

Rob




"Shaunn Johnson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Howdy:
>
> I have a text file that I'm trying to use, but, it has control characters
> at the end.
>
> [snip]
>
> test.txt: ASCII text, with very long lines, with NEL line terminators
>
> [/snip]
>
> I've tried to use 'sed' and 'tr' to remove NEL and just have
> an ASCII text.  I've even used dos2unix, but that doesn't
> seem to help.
>
> I thought I could do it with chomp / chop, but I don't think I'm
> doing it properly.
>
> How can I remove things like CL/LF, NEL, etc from a
> text file?
>
> Thanks!
>
> -X
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to