From: Danish on
Hi,


Please tell me how to remove the non printing characters from a test
file. I am trying to use te dos2unix utility under solaris but my user
has not been given permission of the /tmp directory because of which
the utility is not able to create a temporary file. I suspect it
requires the access to create a file.

cat -v file prints the non printing characters but im not able to
figure out how to redirect the file to a new file (if thats possible)
so that it doesnt contain the non printing charaters.


help will be appreciated a lot

thanks
From: Marcel Bruinsma on
Am Samstag, 3. Oktober 2009 14:15, Danish a écrit :

> Please tell me how to remove the non printing characters
> from a test file.

awk '{gsub("[^[:print:]]","")}1' file >newfile

--
printf -v email $(echo \ 155 141 162 143 145 154 142 162 165 151 \
156 163 155 141 100 171 141 150 157 157 056 143 157 155|tr \ \\\\)
# Live every life as if it were your last! #
From: Lew Pitcher on
On October 3, 2009 08:15, in comp.unix.shell, Danish
(me.linuxadmin(a)gmail.com) wrote:

> Hi,
>
>
> Please tell me how to remove the non printing characters from a test
> file.

cat test_file | tr -cd '[:print:]'

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------


From: pk on
Lew Pitcher wrote:

> On October 3, 2009 08:15, in comp.unix.shell, Danish
> (me.linuxadmin(a)gmail.com) wrote:
>
>> Hi,
>>
>>
>> Please tell me how to remove the non printing characters from a test
>> file.
>
> cat test_file | tr -cd '[:print:]'

Careful with that one...it will remove newlines! Maybe this:

tr -cd '[:print:]\n' < test_file
From: Kenny McCormack on
In article <3784501.N2KK5ppBuW(a)xkzjympik>, pk <pk(a)pk.invalid> wrote:
>Lew Pitcher wrote:
>
>> On October 3, 2009 08:15, in comp.unix.shell, Danish
>> (me.linuxadmin(a)gmail.com) wrote:
>>
>>> Hi,
>>>
>>>
>>> Please tell me how to remove the non printing characters from a test
>>> file.
>>
>> cat test_file | tr -cd '[:print:]'
>
>Careful with that one...it will remove newlines! Maybe this:
>
>tr -cd '[:print:]\n' < test_file

The OP said he wanted to remove non-printing characters...

 |  Next  |  Last
Pages: 1 2 3 4
Prev: SED help -
Next: AIX iconv question