newline

copy paste table to chrome, textarea.value no new lines

try this in chrome (ff,ie works ok): in msword or writer make a 3 row table. In each row put something, select all rows and copy paste to chrome textarea. Each row is now in new line but when you check textarea.value there is no new lines ..strange even spliting by \n or \r not working textarea.value always return one line output any id...

Is \n multi-character in C?

I read that \n consists of CR & LF. Each has their own ASCII codes. So is the \n in C represented by a single character or is it multi-character? Edit: Kindly specify your answer, rather than simply saying "yes, it is" or "no, it isn't" ...

Can't see new lines on textarea - what could the problem be?

Hello all, I have a php string with a lot of information to be displayed inside a textarea html element. I don't have access to that textarea nor to the script (if any) that generates it. $somestring = 'first line \nSecond line \nThird line.'; $somestring as NOT been "worked" with trim or filter_var. Nothing. On the textfield, I g...

PHP script printing unnecessary new lines

Hi. I'm actually working on a booking system in PHP and I created a script that searches a MySql database checking if a X day is occupied (or not) storing un-occupied dates in an array. After that, I return the array to a function that prints all dates, passing those dates to a jQuery Datepicker array variable, so Datepicker knows which ...

What is the universal newline for all operating systems? (LF and CR)

When I write a file using Delphi it's on a Windows machine and the text files it puts out work fine on windows. When I use it on a Mac though it's expecting the formatting to be a bit different. On Mac the newline is different and it can't always read the Windows files. How can I make my files readable by mac programs? ...

CRLF (\r\n) in PHP's header() function

Why/when does one has to use CRLF's at the end of header in PHP? Here is one example (it's not necessarily correct): header("method: POST\r\n"); header('Host: '.get_option('transact_url')."\r\n"); header('Content-type: application/x-www-form-urlencoded'); header('Content-length: '.strlen($transaction)."\r\n"); header($transaction."\r\n\...

How this simple program works, I/O related

This is my program: #include <stdio.h> int main(int argc, char* argv[]) { char buf[1024] = {0}; setvbuf(stdout, buf, _IOFBF, 1024); printf("error\n"); printf("%s\n", buf); } And this is the output: error error Exited: ExitFailure 7 Why are both lines 3 and line 4 blank lines ? Isn't the character '\n' flushing the output b...

MySQL slashes and nl2br

Hi. I am trying to store HTML posted from a textarea into a database. I have a textarea inside a form which I have called "message". The PHP code that processes it is: if(isset($_POST['submit'])){ if(isset($_POST['title']) && isset($_POST['message'])){ $title = $_POST['title']; $message = $_POST['message']; ...

Copying binary file changes newline character to window's standard..? Java

Hello everyone! For some reason, this code is changing any '\n' characters from the input and replacing it with '\n\r' in the new outputed file. I reference a couple websites, and still haven't figured it out.. Anyone have an idea? Thanks a lot! Socket connectionSocket = sData.accept(); InputStream inputStream = connectionSocket.getInp...

Reportlab - how to introduce line break if the paragraph is too long for a line

I have a list of text to be added to a reportlab frame style = getSampleStyleSheet()['Normal'] style.wordWrap = 'LTR' style.leading = 12 for legend in legends: elements.append(Paragraph(str(legend),style)) If the legend is too long, the text at the end is not visible at all. How to introduce line breaks in this situation. ...

How to detect newline character(s) in string using Visual Studio 6 C++

I have a multi-line ASCII string coming from some (Windows/UNIX/...) system. Now, I know about differences in newline character in Windows and UNIX (CR-LF / LF) and I want to parse this string on both (CR and LF) characters to detect which newline character(s) is used in this string, so I need to know what "\n" in VS6 C++ means. My ques...

How do I programmatically add NewLines to a TFS work item textbox?

I have a web system that has a few hooks into our TFS work item system. One of the things I am trying to do is that when a certain action is performed, it takes the current text in one field and makes a comment in the "General Comments" field announcing what the field was previously (Yes I know, history contains this but the higher ups ...

Odd ASCII characters in NMEA 0813 data stream

Hello, i have been trying to read the NMEA data stream from my GPS receiver connected to a bluetooth module BlueNiceCom3 using various terminal programs (HTerm, MTTTY) but what i received was always like this: C O"i „ $GPGGA,0i „ 85649.99i „ 9,4900.1i „ 692,N,01i „ 205.7215i „ ,E,0,00,i „ 0.0,433.i „ 7,M,0.0,i „ M,,0000*i „ 67 $GPGi „ ...

Why does Vim on windows use \n for searching?

So I was changing code from foo() { to foo() { and I noticed that the searching pattern required me to search for \n, but when I tried to replace it with \n I got the ^@ character, and I had to instead replace with \r. It seems strange to me that I search with \n and replace with \r, any idea why this might be? For reference my ...

Table putting words with spaces on different lines

I am trying to make a table in HTML. When I resize the window down to be narrow and the window tries to squash everything to fit inside the window even though it's narrow, it puts the contents of a cell on different lines. I don't want this to happen. E.g.: home about contact us when you narrow down the browser window: home ...

Python: How to remove /n from a list element?

I'm trying to get Python to a read line from a .txt file and write the elements of the first line into a list. The elements in the file were separated with a TAB so I used split("\t") to separate the elements. Because the .txt file has a lot of elements I saved the data found in each line into a separate list (data from the first lin...

See line breaks and carriage returns in editor

Does anyone know of a text editor on linux that allows me to see line breaks and carriage returns? Does vim support this feature? Thanks. ...

Searching for newlines in a Oracle DB using SQL 'like' clause

I'm trying to see if a particular column in a table in my Oracle database has any strings which contain a newline character, so a wildcard, a newline, and another wildcard. I've tried the like command and a combination with CHR(10) and tried escaping the newline itself, but to no avail. What would be the proper way to detect a newline ...

How to send line break with curl?

I've tried the following to send a line break with curl, but \n is not interpreted by curl. curl -X PUT -d "my message\n" http://localhost:8000/hello How can I send a line break with curl? ...

Converting newlines to spaces in Latex

I'm writing a document and I have a few chapter titles that I would like to appear as 2 lines for a chapter title, but only one line in the table of contents. Is there a simple command I to filter out the newline character like this? Chapter Title First Line: Second more informative line ToC: First Line: Second more infor...