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
4
votes
2 answers

Find/replace string with carriage return and line feed in PowerShell

Is there a way to have PowerShell find and replace a string (for example ~}}|{{E) with a carriage return and line feed (\r\nE)? For example: $filenames = @("E:\blergfest.csv") foreach ($file in $filenames) { $outfile = "$file" + ".out" …
Jerry Sweeton
  • 163
  • 2
  • 4
  • 15
4
votes
1 answer

Matching Unicode control characters except for three with Regular Expressions

I would need to get a Regular Expression, which matches all Unicode control characters except for carriage return (0x0d), line feed (0x0a) and tabulator (0x09). Currently, my Regular Expression looks like this: /\p{C}/u I just need to define these…
Tower
  • 98,741
  • 129
  • 357
  • 507
3
votes
2 answers

Node JS REPL, Sockets, and Telnet - Tab Completion, Arrow Keys, etc

I have been playing around with Node's REPL. I thought it would be pretty cool to make it available via a Socket, connect to it via Telnet/puTTY/whatever, and debug my server on-the-fly. I used the example found here:…
BMiner
  • 16,669
  • 12
  • 53
  • 53
3
votes
4 answers

Escaping control characters in Oracle XDB

I'm completely new to Oracle's XDB, in particular using it to generate XML output from a database table, and am working on an application which is moving from 9i (Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production) to 11g (Oracle Database…
DaveyDaveDave
  • 9,821
  • 11
  • 64
  • 77
3
votes
4 answers

Remove "Invisible" Control Characters in VB.Net

I am currently reading in a text file in VB.Net using Dim fileReader As String fileReader = My.Computer.FileSystem.ReadAllText(file) File contains several lines of text and when I read in the text file, it knows that they are on separate lines and…
Kyle Uithoven
  • 2,414
  • 5
  • 30
  • 43
3
votes
1 answer

Why Javascript string.replace("\n\t","xxx") replaces "\n\t" with "\nxxx"?

I expect to replace "\n\t" with "xxx" in a txt file: "数字多功能光盘 DVD shùzì" I do this: str.replace("\n\t","xxx") method matches needed parts but leaves \n part and only replaces \t for 'xxx'.WHY? why when use crtl+F in VSCOde and it works like…
coobit
  • 247
  • 1
  • 6
3
votes
1 answer

Why does '\x01\x1A' (Start-of-Header and Substitute control characters) in a textfile line stop a for-loop prematurely?

I'm using Python 2.7.15, Windows 7 Context I wrote a script to read and tokenize each line of a FileZilla log file (specifications here) for the IP address of the host that initiated the connection to the FileZilla server. I'm having trouble parsing…
Minh T.
  • 33
  • 5
3
votes
0 answers

why doesn't ctrl+d exit ghci in emacs shell ... but does exit for the python REPL?

When using the emacs shell buffer, the control-d keystroke doesn't exit from the ghci REPL but does exit the python REPL. Rather than exiting, gchi reports lexical error at character '\EOT'. How can I get control-d to properly exit the ghci REPL in…
Rick Majpruz
  • 641
  • 3
  • 16
3
votes
2 answers

Replace a character with control character Field Seperator(\034) in powershell

(Get-Content C:\Users\georgeji\Desktop\KAI\KAI_Block_2\Temp\KAI_ORDER_DATARECON3.NONPUBLISH) | Foreach-Object {$_ -replace "~", "\034"} | Set-Content C:\Users\georgeji\Desktop\KAI\KAI_Block_2\Temp\KAI_ORDER_DATARECON4.NONPUBLISH I am using the…
TomG
  • 281
  • 1
  • 2
  • 20
3
votes
1 answer

Python XML Compatible String

I am writing an XML file using lxml and am having issues with control characters. I am reading text from a file to assign to an element that contains control characters. When I run the script I receive this error: ValueError: All strings must be XML…
Joel Parker
  • 295
  • 1
  • 4
  • 17
3
votes
0 answers

JsonParsing : UTF-8 encoding : JsonParseException: Illegal unquoted character

I am trying to parse a JSON which is obtained from rest service via RestTemplate. When I try to parse a JSON which contains a newline or tab character, it is throwing the following exception: org.codehaus.jackson.JsonParseException: Illegal unquoted…
RahulArackal
  • 944
  • 12
  • 28
3
votes
2 answers

Java code does not recognize ctrl-m(^M) but works fine for other ctrl-characters(^Q,^A,^T etc) Linux

I have a requirement where I need to remove two specific control characters: ^@ and ^M, from the incoming data in Java on a Linux box. Below mentioned parts work as expected: String s; s = s.replaceAll("\\x00","as"); s = s.replaceAll("\\000",…
user3032283
  • 373
  • 2
  • 10
3
votes
2 answers

String literal containing control characters

I'm creating a sort of interactive tutorial that works like the following: echo "What do you press if you want to move one word backwords in bash?" read ans if [ "$ans" == "ESCb" ]; then echo RIGHT! else echo WRONG! fi Now, how can I input the…
Boyang
  • 2,520
  • 5
  • 31
  • 49
3
votes
2 answers

Removing binary control characters from a text file

I have a text file that contains binary control characters, such as "^@" and "^M". When I try to perform string operations directly on the text file, the control characters crash the script. Through trial and error, I discovered that the more…
svengineer99
  • 43
  • 1
  • 6
3
votes
1 answer

Paste from Word + Create XML document -> hexadecimal value 0x0C, is an invalid character (.Net)

I have a webpage that accepts HTML-input from users. The input is converted into an xml document using the System.Xml namespace, like this: var doc = new…
Martin Ørding-Thomsen
  • 7,207
  • 3
  • 21
  • 22