[SOLVED] filtering out displayable characters in bash
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The first one is displayed normally as a man in a circle, the second one as a heart with sinus rhythm as well, so it should also appear in the issue.
The third is a bordered box with F21F, the fourth is a bordered box with F220, both should not be displayed.
Check a file for characters that cannot be represented symbolically, i.e. filter out the boxes surrounded by hexadecimal numbers.
I wanted to use awk because the lines for the start and end are predefined, and further adjustments are needed.
Check a file for characters that cannot be represented symbolically, i.e. filter out the boxes surrounded by hexadecimal numbers.
Awk does not know how your font will choose to render the characters (i.e. bytes / hex numbers) that it will receive.
The characters you've used are F21D, F21E, F21F, F220 - all four of those are within the E000–F8FF Unicode Private Use Area which seems to mean there is no standardized symbol for any of them, and so you need to determine what defines the first two as valid characters in your context.
After that, well, it depends if/how well Awk deals with multi-byte characters - since Gawk only has single-byte escape sequences, you may be better to use (e.g.) Perl or Python that have explicit support.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.