control-characters

In PHP, how do I send a control character down a socket?

In a PHP script I am writing, I need to send a control+z character down a network socket I have previously created. I understand the ctrl+z character to be chr(26), so at the end of the string I am sending I have added a new line (\r\n) and then the chr(26) as follows: $socket=fsockopen($host['host'],$host['port']); fputs($socket, "I am...

How to send ^K to shell

I want to run a shell command in Terminal, then clear the console, from Applescript. If I was doing this by hand, I'd use ^K -- how do I send the ^K character in a string to Terminal? ...

nmake - how to force echo command to output the tab character?

Hi How to force echo command to output a tab character in MS nmake makefile? Verbatim tabs inserted right into a string after echo command are removed by nmake and don't show up in the output file. all : @echo I WANT TO OUTPUT THE <TAB> CHARACTER HERE! > output.txt ...

Matching Unicode control characters except for three with Regular Expressions

Hi, 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 three exceptions now. ...

Can I put control characters in XML via XSLT?

I have the following problem: I have an XML and an XSLT file to process this it and generate output. The output of this process should contain a control character '0B'. And as far as I know, XML doesn't embed control characters, so how can I accomplish this? ...

detecting end of tty output

Hi I'm writing a psudo-terminal that can live in a tty and spawn a second tty which is filters input and output from I'm writing it in python for now, spawning the second tty and reading and writing is easy but when I read, the read does not end, it waits for more input. import subprocess pfd = subprocess.Popen(['/bin/sh'], shell=Tru...

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 returns and commas, in which case it is surrounded by double quotes. And I need to preserve...

Why is '\x' invalid in Python?

I was experimenting with '\' characters, using '\a\b\c...' just to enumerate for myself which characters Python interprets as control characters, and to what. Here's what I found: \a - BELL \b - BACKSPACE \f - FORMFEED \n - LINEFEED \r - RETURN \t - TAB \v - VERTICAL TAB Most of the other characters I tried, '\g', '\s', etc. just eva...

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 XmlDocument(); doc.AppendChild(doc.CreateElement("root")); doc.DocumentElement.SetAttribute("BodyHTML", theTextBox.Text); Afterwards an Xsl transformation (System.Xml.Xsl.XslCompiled...

cscript - print output on same line on console?

If I have a cscript that outputs lines tothe screen, how do I avoid the "line feed" after each print? Example: for a = 1 to 10 WScript.Print "." REM (do something) next The expected output should be: .......... Not: . . . . . . . . . . In the past I've used to print the "up arrow character" ASCII code. Can this be done i...

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

Hi. 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."); resetEvent.Set(); }); And the output windows shows: 6/16/2010 3:24:34 PM: Control+C hit. Shutting dow...

What are carriage return, linefeed, and form feed?

What is the meaning of the control characters carriage return, linefeed, and form feed? ...

Are Fortran control characters (carriage control) still implemented in compilers?

In the book Fortran 95/2003 for Scientists and Engineers, there is much talk given to the importance of recognizing that the first column in a format statement is reserved for control characters. I've also seen control characters referred to as carriage control on the internet. To avoid confusion, by control characters, I refer to the c...

Why does this C program print weird characters in output?

Dear all, I've the following program: #include <stdio.h> int main() { int ch; while( ch = getchar() != '\n') { printf("Read %c\n",ch); } return 0; } No matter what I enter I get: Read Why is this happening and what is that weird char that I see? Stackoverflow is not printing th...