Questions tagged [control-characters]

Control characters are non-printing characters used to send signals to the output terminal.

Control characters are generally non-printing characters that are used to send signals to the output terminal.

More information is available on Wikipedia.

218 questions
6
votes
3 answers

Powershell: Find/Replace pattern of ASCII control characters

I'm trying to write a script to search the contents of a file, and when it comes across a grouping of ASCII control characters, to insert a CR/LF. The pattern of characters I would like to replace are [ETX][NUL][STX][ETX][SOH] $filenames =…
Jerry Sweeton
  • 163
  • 2
  • 4
  • 15
5
votes
1 answer

Updating current line in VB Console

I am trying to write out to console a percentage of data loading. I tried to use C# syntax which would be Console.Write("\rPercentage: " + nCurrent + "/" + nTotal; however in VB I get the actual character 'r' being displayed in my string. Is there a…
Seb
  • 3,414
  • 10
  • 73
  • 106
5
votes
1 answer

Escape codes for control characters in C# string

I want to find the codes for the below control characters used in Microsoft Word. I have found some of them. Please correct me if I am wrong. I have browsed the web for them. But I was unable to find some of the codes.
ApsSanj
  • 549
  • 7
  • 23
5
votes
1 answer

Switching from Keras to tf.keras spams my screen with #010

I've built a simple Keras model for experimentation within Amazon SageMaker. I'm using Python 3.5 TensorFlow 1.12.0. Recently I switched my model to use TensorFlow.keras, but doing so has resulted in the printing of #010 repeatedly followed by #015,…
Austin
  • 6,921
  • 12
  • 73
  • 138
5
votes
2 answers

Why does irb insert control characters into my reverse-interactive-search buffer?

If I do a reverse interactive search in irb and then enter a control character (arrow keys are the only ones I've seen this with actually). So I start with this session: $ irb >> print "hello" hello then enter ^r, h $ irb >> print…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
5
votes
1 answer

Java regular expression \cx (control characters)

Javadoc for java.util.regex.Pattern says \cx represents The control character corresponding to x. So I thought Pattern.compile() would reject a \c followed by any character other than [@-_], but it doesn't! As @tchrist commented on one of the…
user1089451
5
votes
3 answers

C# Console Application: Preventing Control-C from being printed?

I have a console app, and I want to capture Control-C and shutdown gracefully. I have the following code: Console.CancelKeyPress += new ConsoleCancelEventHandler((o, e) => { Logger.Log("Control+C hit. Shutting down."); …
Alan
  • 45,915
  • 17
  • 113
  • 134
5
votes
2 answers

Find Control Characters written in bytes in Java

I had a question about the control characters. I have to found them in a string and delete them. Made some research and found useful tips. I wrote this: output.toString().replaceAll("[\\p{Cntrl}\\p{Cc}]","") But I was asked if this method can find…
Tony
  • 85
  • 1
  • 7
4
votes
3 answers

Using a Regular Expression to Find XML character references for control characters

I need some help figuring out the regex for XML character references to control characters, in decimal or hex. These sequences look like the following: �     In other words, they are an ampersand, followed by a…
Ken Mason
  • 712
  • 2
  • 7
  • 16
4
votes
2 answers

Why must I use \x1b not \ to represent an escape character

I've read that \x1b represents the escape character, but isn't '\' by itself the escape character? A tutorial wants me to write write(STDOUT_FILENO, "\x1b[2J", 4); to clear the screen. Why won't '\[2J' do the job?
Luke Kong
  • 71
  • 1
  • 7
4
votes
1 answer

How to replace multiple lines from a text file using Powershell -replace

I am writing a script changing the memory value within a configuration file. I want to search for a set specific set of lines within this file, and I tried using PowerShell to do the job. It works fine for a single line replace, but trying to match…
Cap10Br8KDance
  • 43
  • 1
  • 1
  • 5
4
votes
1 answer

How to display and write all distinct white space and control characters in VS Code (or other text editor)

I would like to be able to see all whitespace and control character explicitly in my text editor. Example Hi world! This is a new line! (pretend the new line is actually on a new line) as something like Hi\sworld!\nThis\sis\sa\snew\sline!. Or…
4
votes
0 answers

Why does System.IO.DirectoryInfo allow constructing a path ending in form feed?

While writing some property-based tests in F#, I have discovered a very strange behavior of the constructor of System.IO.DirectoryInfo. Based on the documentation, I would expect an ArgumentException to be thrown any time I try to construct a…
Keith Pinson
  • 7,835
  • 7
  • 61
  • 104
4
votes
1 answer

how to automatically escape control-characters in a Python string

I have strings with control-characters in them, and I want to make them visible (for printing documentation of them, for instance). For example, I have dialect = csv.sniffer().sniff(csvfile.read(1024)) and I want to print the contents…
4dummies
  • 759
  • 2
  • 9
  • 22
4
votes
6 answers

How to bulk insert from CSV when some fields have new line character?

I have a CSV dump from another DB that looks like this (id, name, notes): 1001,John Smith,15 Main Street 1002,Jane Smith,"2010 Rockliffe Dr. Pleasantville, IL USA" 1003,Bill Karr,2820 West Ave. The last field may contain carriage…
z-boss
  • 17,111
  • 12
  • 49
  • 81
1 2
3
14 15