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
1
vote
4 answers

print until end of line in java

In Java, I am trying to print a word that the user inputs 100 times but instead of having it print each instance on a new line, I am trying to print as many as I can on one line and then go to a new line. Would this be easy to do in java? I am new…
John
  • 139
  • 1
  • 12
1
vote
1 answer

Python regex: How to match a string at the end of a line in a file?

I need to match a string at the end of a line of a file. The contents of the file are: network1: type: Internal I have made this regex to get the first line but it does not match anything. Note that my code's requirement is that the string…
user189942
  • 351
  • 1
  • 3
  • 12
1
vote
1 answer

"Optional" end of line $ literal (non greedy)

I would like to make the "end of line" character ($) "optional" (or non-greedy). Meaning, I want to capture a certain pattern at the end of the line, or none. This is the regex I've built: (.+\s*)\s*(?:(\(\s*[xX\*]\s*\d+\s*\))|$) I would like to…
Hummus
  • 559
  • 1
  • 9
  • 21
1
vote
3 answers

How can I ignore the "end of line" or "new line" character when reading text files word by word?

Objective: I am reading a text file word by word, and am saving each word as an element in an array. I am then printing out this array, word by word. I know this could be done more efficiently, but this is for an assignment and I have to use an…
radiomime
  • 118
  • 1
  • 1
  • 11
1
vote
3 answers

C++ - Read file until reaching end of line with >> operators

I have looked around a lot, and still not found how to do this, so, please bear with me. Let's say i have to read a txt file that contains different kinds of data, where the first float is an id, and then there are a few (not always the same amount)…
pineapple-na
  • 29
  • 1
  • 1
  • 6
1
vote
1 answer

StarTeam: EOL format for Binary files like Images

I have binary files in my StarTeam Projects like images with extension (*.gif, *.bmp). I have check-in them in StarTeam using EOL format Windows (CRLF). But when I checkout them, they are Unix EOL format (LF). So I wanted to change the EOL of these…
Jemru
  • 2,091
  • 16
  • 39
  • 52
1
vote
3 answers

bash sed processing data with end of line or potentially something else

I have this two types of outputs: UID:474D229F698D494E889D85CEF9303B97:480 f UID:474D229F698D494E889D85CEF9303B97:480 I want to get the 32 char long uid with the 480 at the end of it. (Note that there is nothing after 480 for the second type of…
Juto
  • 1,246
  • 1
  • 13
  • 24
1
vote
4 answers

Replace String by another until the end of line

I have a java string like this one : Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed scelerisque enim a ornare auctor. Duis quam nisi, mattis vel leo eu, luctus porta
wawanopoulos
  • 9,614
  • 31
  • 111
  • 166
1
vote
1 answer

is '$' in Regex finds break line or not in c#

When i Execute this code i got some interesting results. string readText = File.ReadAllText("d:\\temp.txt"); Console.WriteLine(readText); Console.WriteLine("From File: "+Regex.Matches(readText,"$").Count);//-->2 Console.WriteLine("Add…
Civa
  • 2,058
  • 2
  • 18
  • 30
1
vote
1 answer

Dot and word boundary at the end of the line

I have this regular expression: \ba\.?b\.?c\.?\b( something)? that matches abc a.b.c. a.b.c. something ... I use it 2 times in order of importance: first I try to add ^ at the begin and $ at the end of the line because I'd like to find a string…
user1679640
1
vote
2 answers

jsoup to strip only html tags not new line character?

I have below content in Java where I want to strip only html tags but not new line characters

test1 test2 test 3

//line 1

test4

//line 2 If I open above content in text rich editor, line 1 and line 2 are displayed in…
emilly
  • 10,060
  • 33
  • 97
  • 172
1
vote
3 answers

Regular expression to match beginning and end of a line?

Could anyone tell me a regex that matches the beginning or end of a line? e.g. if I used sed 's/[regex]/"/g' filehere the output would be each line in quotes? I tried [\^$] and [\^\n] but neither of them seemed to work. I'm probably missing…
Dom Brown
  • 201
  • 1
  • 2
  • 9
1
vote
1 answer

Vim (7.3.3 Windows 64bit): Add ^M to end of line if there is none (ff=unix)

I have some 100,000+ files with partially mangled data, mixed text+binary files (a single file of jpg image data with http headers), where some header fields have dos style ^M^J line termination, and some only unix style ^J. When vim opens a file…
kilves76
  • 522
  • 1
  • 3
  • 15
0
votes
6 answers

Efficient means of finding the position of the end of a line

I'm working with C++, ifstream, and text files. I am looking for the position of the end of each line, because I need read n characters from the end of the line. Currently, I am reading every byte and testing if it corresponds to the Unix newline…
Nanik
  • 603
  • 1
  • 12
  • 19
0
votes
2 answers

Regex: selecting end of line character of lines NOT containing 3 semicolons

I'm using the Regex enabled Search&Replace function in EditpadLite. My document looks like…
Hans Roelofsen
  • 741
  • 1
  • 7
  • 13
1 2 3
8 9