non-printing-characters

What is the “M- notation” and where is it documented?

依然范特西╮ 提交于 2019-12-07 00:47:16
问题 The Man-Page of cat says: -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB What is the M- notation and where is it documented? Example: $cat log -A wrote 262144 bytes from file test.x in 9.853947s (25.979 KiB/s)^M$ ^M> ^H^H ^H^H> What means ^M and ^H ? 回答1: I was wondering this too. I checked the source but it seemed easier to create a input file to get the mapping. I created a test input file with a Perl scrip for( my $i=0 ; $i < 256; $i++ ) { print ( sprintf( "%c is %d

Remove non printable utf8 characters except controlchars from String

痞子三分冷 提交于 2019-12-06 04:26:14
问题 I've got a String containing text, control characters, digits, umlauts (german) and other utf8 characters. I want to strip all utf8 characters which are not "part of the language". Special characters like (non complete list) ":/\ßä,;\n \t" should all be preserved. Sadly stackoverflow removes all those characters so I have to append a picture (link). Any ideas? Help is very appreciated! PS: If anybody does know a pasting service which does not kill those special characters I would happily

Is it possible to echo some non-printable characters in batch/cmd?

早过忘川 提交于 2019-12-05 13:10:30
motivation I have a 3rd party, somehow long .bat file written for some specific function and would take considerable effort to re-write (which effort is also hindered by my problem). In for loops the most basic way to debug it would seem echoing some information to the screen. I used to do this with \r (0x0D) character in other languages that on some terminals/console re-writes the same line (to avoid overflooding, since in my case the last line would contain the error). I already save the value to a variable. However, since iteration might take quite long, I'd still be happy to write some

What is the “M- notation” and where is it documented?

五迷三道 提交于 2019-12-05 04:47:39
The Man-Page of cat says: -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB What is the M- notation and where is it documented? Example: $cat log -A wrote 262144 bytes from file test.x in 9.853947s (25.979 KiB/s)^M$ ^M> ^H^H ^H^H> What means ^M and ^H ? I was wondering this too. I checked the source but it seemed easier to create a input file to get the mapping. I created a test input file with a Perl scrip for( my $i=0 ; $i < 256; $i++ ) { print ( sprintf( "%c is %d %x\n", $i, $i ,$i ) ); } and then ran it through cat -v Also if you see M-oM-;M-? at the start of a file it

Remove non printable utf8 characters except controlchars from String

ぐ巨炮叔叔 提交于 2019-12-04 07:30:37
I've got a String containing text, control characters, digits, umlauts (german) and other utf8 characters. I want to strip all utf8 characters which are not "part of the language". Special characters like (non complete list) ":/\ßä,;\n \t" should all be preserved. Sadly stackoverflow removes all those characters so I have to append a picture ( link ). Any ideas? Help is very appreciated! PS: If anybody does know a pasting service which does not kill those special characters I would happily upload the strings.. I just wasn't able to find one.. [Edit]: I THINK the regex "\P{Cc}" are all

Remove special characters from data frame

房东的猫 提交于 2019-11-30 07:27:29
I have a matrix that contains the string "Energy per �m". Before the 'm' is a diamond shaped symbol with a question mark in it - I don't know what it is. I have tried to get rid of it by using this on the column of the matrix: a=gsub('Energy per �m','',a) [and using copy/paste for the first term of gsub], but it does not work.[unexpected symbol in "a=rep(5,Energy per"]. When I try to extract something from the original matrix with grepl I get: 46: In grepl("ref. value", raw$parameter) : input string 15318 is invalid in this locale How can I get rid of all this sort of signs? I would like to

Invisible Delimiter for Strings in HTML

旧街凉风 提交于 2019-11-29 19:57:26
I need a way to identify certain strings in HTML markup. I know what the strings are, but it is possible that they could be substrings of other strings in the document. To find them, I output a special delimiter character (currently using \032 ). On page load, we go through the HTML and record the location of the strings, and remove the delimiter. Unfortunately, most browsers show the delimiter character until we can find and remove them all. I'd like to avoid that if possible. Is there a character or string that will be preserved in the HTML content (so a comment wont work) but wont be

Invisible Delimiter for Strings in HTML

天涯浪子 提交于 2019-11-28 15:37:37
问题 I need a way to identify certain strings in HTML markup. I know what the strings are, but it is possible that they could be substrings of other strings in the document. To find them, I output a special delimiter character (currently using \032 ). On page load, we go through the HTML and record the location of the strings, and remove the delimiter. Unfortunately, most browsers show the delimiter character until we can find and remove them all. I'd like to avoid that if possible. Is there a

serialization ArrayList Java

感情迁移 提交于 2019-11-28 12:12:18
I want to serialize the Arraylist of type ArrayList<Class> and the class contains two Arraylist of primitive type public class Keyword { private long id; private long wid; private String name; private ArrayList<Integer> rank; private int month; private float avg; private ArrayList<String> date; ... and so on } How can i do that? Lots of thanks in advance Ivaylo Petrov If you want to use Serializable, you should have no problems, because ArrayList is Serializable just as String and every primitive type. public class Keyword implements Serializable {} should do. You can read more about this

How to replace non-printable unicode characters (Javascript)

青春壹個敷衍的年華 提交于 2019-11-27 12:50:34
I've already wasted a good amount of time dealing with strings (generated by some other source) and I found out that the problem was that the strings have non-printable characters. Today I am dealing with javascript. Does anyone know how to replace non-printable unicode characters in javascript? I found something similar here: How can I replace non-printable Unicode characters in Java? my_string.replaceAll("\\p{C}", "?"); and here: Non-ascii characters added form input only with Safari Browser filename.replace(/[^a-z0-9\.]+/gi, ""); The last option replaces all the characters that are not in