linefeed

PHP: Is it ok to replace \r\n with \n?

I have a form with a textarea and a JS character counter. Yet the backend script claims that the strlen of the message is longer than the JS character counter claimed. The reason for this, I have discovered, is that the backend sees every newline character as \r\n which is two characters. Can I simply have it do a str_replace("\r\n","\n...

Problem copy+pasting CR+LF into an excel spreadsheet need soft paragraph (Alt+Enter)

I'm trying to copy a table that is created in our software into an excel spreadsheet. Some of the title headers in our application are too big to fit in a column so they are separated by a #13+#10 (CR+LF) so they sit on the next line. e.g. Strain SpikeConc Spike ng/g dpm/g ------------------------- Blah 20.0 5...

exporting access query to text file line feed

I am creating a sql query for an access database that will be exported to a text file. The requirements include a line feed separating each line. Does that happen by default, or its something that I need to add in? If I need to add it, how do I do that? TIA ...

How to read line by line a CR-only file with Perl?

I'm trying to read a file which has only CR as line delimiter. I'm using Mac OS X and Perl v.5.8.8. This script should run on every platform, for every kind of line delimiter (CR, LF, CRLF). My current code is the following : open(FILE, "test.txt"); while($record = <FILE>){ print $record; } close(TEST); This currently print onl...

git crlf configuration in mixed environment

I'm running a mixed environment, and keep a central, bare repository where I pull and push most of my stuff. This centralized repository runs on Linux, and I check out to Windows XP/7, Mac and Linux. In all repositories I put the following line in my .git/config: [core] autocrlf = true I don't have the flag safecrlf=true anywhere...

Replace CR with CRLF in a Textfield

Hello, i got some problem with replacing a CarriageReturn (CR) to a CarriageReturn LineFeed (CRLF) entry´s in a textfield on MS SQL 2005 System. There´s a table "notice" where a textfield "desc" is filled with some content which contains some CR. So some example is: Mister Smith "CR" Road 123 "CR" Germany I try to replace the CR with...

Why do I get different EOL for different files?

What can cause Notepad++ to make new lines as CRLF in one file and only LF in the other? Both files were created at the same folder from the same OS and no modifications to Notepad++ preferences were made, AFAIK... Is there any option in Notepad++ that changes how new lines are defined? ...

SQL Server BCP only one row inserted?

I'm using an FMT file to BCP a csv file into a an SQL Server Box - everything is fine, but only the first row of the 5 line file is getting inserted. I think it is the line feed settings for the terminator of the final column - but how do I view and edit the line feeds in the csv file? ...

Setting Java VM line.separator

Hi, has anybody found a way how to specify the Java line.separator property on VM startup? I was thinking of something like this: java -Dline.separator="\n" But this doesn't interprete the "\n" as linefeed character. Any ideas? Regards, Martin. ...

In C#, what's the difference between \n and \r\n?

As per subject... ...

Regular expression to replace line feeds with a space only if the break is not in the contents of an HTML attribute

I'm trying to write a regular expression that replaces line feeds between certain areas of a text file, but only on plain text content (i.e. excludes text inside HTML attribute contents, like href) but not having much luck past the first part. Example input: AUTHOR: Me DATE: Now CONTENT: This is an example. This is another example. <a ...

notepad++ regular expression delete line starting with \pard.....ending with line feed

I'm cleaning up files using notepad ++, and trying to delete lines that start with \pard and have some text then end with a line feed. But \n doesn't work in regular expression and .* doesn't work in an extended find and replace. This is what I've tried unsuccessfully. \pard.*\n \pard.* works but leaves the line feed in regex. Any ide...