Sponsored Content
Top Forums Shell Programming and Scripting removing non-printable chars from multiple files Post 302278103 by zaxxon on Monday 19th of January 2009 10:18:43 AM
Old 01-19-2009
Try this:
Code:
ls -1 | while read FNAME; do tr -d '[:cntrl:]' < "${FNAME}" > "${FNAME}".out; done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing M^ from multiple files

to do this i usually type dos2unix <file> -o <file> and this will remove the M^ from the end of each file. well i have over 100 files that someone copied that i need. how do i remove the M^. i saw a perl script but i am not familiar with .pl at all really (7 Replies)
Discussion started by: deaconf19
7 Replies

2. Shell Programming and Scripting

Removing Non-printable characters in unix file

Hi, We have a non printable character "®" in our file , we want to remove this character, we tried tr -dc '' < oldfile> newfile but this command is removing all new line entries along with the non printable character and all the records are coming in one line(it is changing the format of the... (2 Replies)
Discussion started by: pyaranoid
2 Replies

3. UNIX for Dummies Questions & Answers

removing non printable characters

Hi, in a file, i have records as below: 123|62|absnb|267629 123|267|28728|uiuip 123|567|26761|2676 i want to remove the non printable characters after the end of each record. I guess there are certain charcters but not visible. i don't know what character that is exactly. I used... (2 Replies)
Discussion started by: pandeesh
2 Replies

4. Shell Programming and Scripting

Removing unknow chars from file names.

I'm trying to move a large folder to an external drive but some files have these weird chars that the external drive won't accept. Does anyone know any command of any bash script that will look through a given folder and remove any weird chars? (4 Replies)
Discussion started by: Joktaa
4 Replies

5. Shell Programming and Scripting

Removing rows and chars from text file

Dear community, maybe I'm asking the moon :rolleyes:, but I'm scratching my head to find a solution for it. :wall: I have a file called query.out (coming from Oracle query), the file is like this: ADDR TOTAL -------------------- ---------- TGROUPAGGR... (16 Replies)
Discussion started by: Lord Spectre
16 Replies

6. Shell Programming and Scripting

Rename and add chars to multiple files at once

i have a little over 100 files named page1.jpg through page106.jpg. How can I rename them all to remove the page word and add 00 in front of the remaining numbers? I realize this might be multiple commands but cp page*.jpg *.jpg didn't work like I thought it would. (4 Replies)
Discussion started by: zimmerru
4 Replies

7. Shell Programming and Scripting

Removing carriage returns from multiple lines in multiple files of different number of columns

Hello Gurus, I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file. 1|ABC DEF|100|10 2|PQ RS T|200|20 3| UVWXYZ|300|30 4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies

8. UNIX for Beginners Questions & Answers

Change encoding, no removing special chars. inconv

Hi all, I'm using iconv command to change files encoding to UTF-8 If my input file has chars as those are removed creating the file without those special chars. I tried using iconv -c, but there is still the removal. Is there a way to keep those special chars changing just the... (6 Replies)
Discussion started by: mrreds
6 Replies

9. Shell Programming and Scripting

Removing a ? from multiple files

Hi all, I have about 1.8 million files in a directory structre, that contain a ? on the end, for example: /testdocs/1/mar/08/08/images/user/{1234-1234-1234-1234}0? Is there a way to go through the testdocs folder, recursively, and remove the ? from all docs that have one on the end? ... (11 Replies)
Discussion started by: tirmUK
11 Replies

10. Web Development

Stripping of Non-Printable Chars in the Who Is Online Page

Noticed that after changing our site and HTML be to UTF-8 compliant per HTML5 standards, we started to see unprintable chars in the country and city name from the geoip database which converts IP addresses to country and city names. So, I just added this code to that PHP plugin which seems to do... (1 Reply)
Discussion started by: Neo
1 Replies
ISWCNTRL(3)						     Linux Programmer's Manual						       ISWCNTRL(3)

NAME
iswcntrl - test for control wide character SYNOPSIS
#include <wctype.h> int iswcntrl(wint_t wc); DESCRIPTION
The iswcntrl() function is the wide-character equivalent of the iscntrl(3) function. It tests whether wc is a wide character belonging to the wide-character class "cntrl". The wide-character class "cntrl" is disjoint from the wide-character class "print" and therefore also disjoint from its subclasses "graph", "alpha", "upper", "lower", "digit", "xdigit", "punct". For an unsigned char c, iscntrl(c) implies iswcntrl(btowc(c)), but not vice versa. RETURN VALUE
The iswcntrl() function returns nonzero if wc is a wide character belonging to the wide-character class "cntrl". Otherwise, it returns zero. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +-----------+---------------+----------------+ |Interface | Attribute | Value | +-----------+---------------+----------------+ |iswcntrl() | Thread safety | MT-Safe locale | +-----------+---------------+----------------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C99. NOTES
The behavior of iswcntrl() depends on the LC_CTYPE category of the current locale. SEE ALSO
iscntrl(3), iswctype(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2015-08-08 ISWCNTRL(3)
All times are GMT -4. The time now is 07:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy