Questions tagged [end-of-line]

The end of a physical line

The end of a line is usually signaled by the '\n', '\r' or '\r\n' characters.

The line that has ended is the physical line, as is observed by the line-break in the visual text. This is different from the end of a logical line in programming languages, which is signaled by the ; character in many languages including the family of languages, , etc

134 questions
0
votes
1 answer

Regex in xCode: any number of any whitespace characters including "end of line"?

I my case I have the following text: - (NSUInteger) launcherView:(HMLauncherView *)launcherView numberOfIconsInPage:(NSUInteger)page; And I want to find all the matches for this method. The regexp should look like something like…
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49
0
votes
2 answers

Regex to create a group from an entire line, or just up to a given token

I'm using a JavaScript Regex Engine. The regex ^(.*?)\s*(?=[*\[]).* will capture a group containing all the characters up to a [ or * character. It works well with these lines, matching the entire line and capturing the first section: This should be…
James Newton
  • 6,623
  • 8
  • 49
  • 113
0
votes
2 answers

C++ Text File: Writing to the end of a specific line

I'm trying to create a program where I can write a string to the end of a certain line in a text file. For example, this is the text file with just a bunch of random numbers: 12 23 53 23 Now what if I had a program that adds another two-digit…
0
votes
3 answers

Concatenate two lines on condition with awk

I'm trying to concatenate two lines when the number of fiels does not match a given number. Here is an example of input file: 1, z 2 3 4 5, w 6 7 and here is the result I want: 1, z 2 3 4 5, w 6 7 I tried the following code: awk ' { if…
bosonfute
  • 57
  • 7
0
votes
1 answer

SVN end of line characters using windows

Lately I have used notepad++ a bit more than vim. However, when committing my work (done with notepad++) with a shell, the boring ^M windows end of line characters are appearing. I guess notepad++ should have a setting to handle this. Any idea…
Scipion
  • 11,449
  • 19
  • 74
  • 139
0
votes
3 answers

PHP Inserting newlines automatically

I have a php data migration script that serializes an array of text. Somehow, and this is not in my codebase, but the script is inserting \\\\\\\r\\\\\\\n into the string. Here is an example of what the output is like: Product Line: [56313] LEGO…
somejkuser
  • 8,856
  • 20
  • 64
  • 130
0
votes
4 answers

How to remove new of line in ruby variable created from system script

I used chef for automation. In one of my scenarios I need to extract a version number of passenger from rvm installed in my system. I used 'pasver' variable for this: pasver = `/usr/local/rvm/bin/gem list | grep passenger`.sub /.*\((.*)\).*/, '\1' …
vskubriev
  • 826
  • 1
  • 11
  • 21
0
votes
1 answer

Experiencing strange end of line string behavior with Outlook text in .NET

When I try to create the email body from my C# program some funny things happen oItem.Body = text; oItem is a Microsoft.Office.Interop.Outlook.MailItem and text is just an ordinary string containing \n When I do this, the \n gets translated into…
0
votes
2 answers

Trying to tokenize a string

Possible Duplicate: How do I tokenize a string in C++? I have this text file q1 t q2 q2 e q3 q3 x q4 q4 t q5 q6 q11 q5 | q6 q11 I want to extract each element that is separated by a space. For example, in line one I want to be able to…
Tyler Pfaff
  • 4,900
  • 9
  • 47
  • 62
-1
votes
2 answers

Regex working in debugger, but not in JavaScript

I want to get all the content in a text file before the first empty line. I've found a working regex, but when I try to accomplish the same in Javascript it doesn't work. (loading the file's contents is working) async function readDir() { return…
Erik
  • 9
  • 3
-2
votes
1 answer

open a file in Fortran

I wanted to open two files in Fortran, but get the following error message: Fortran Runtime Error: End of line infile_T contains years from 1970 to 2100 and temperature values for these years. Infile_CO2 contains years for the same time period and…
-2
votes
2 answers

C++ check end of line

I got a problem in C++ where I need to parse a file with multiple lines (random strings with random length) and transform the uppercase characters in lowercase character and store the lines in a vector of strings. I'm trying to parse the file…
Ovidiu Firescu
  • 385
  • 3
  • 11
-2
votes
1 answer

c++ ifstream end of line

I have a file that looks like this: e r g d g d f h d r h f .......... And I want to store these characters in a two-dimensional array #include #include using namespace std; int main() { ifstream file("file.txt"); char…
jeff
  • 3
  • 1
  • 4
-4
votes
3 answers

What is the alternate to \n in python?

I want to print the following output in python: 99 buckets of bits on the bus. 99 buckets of bits. Take one down, short it to ground. 98 buckets of bits on the bus. with a single print command and no "\n" characters in between. How can this be…
Sulav Timsina
  • 703
  • 7
  • 20
1 2 3
8
9