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
0 answers

Syntax error at input 'end of line without line continuation'

The code is producing this error in line 5:13: Syntax error at input 'end of line without line continuation'; Below the piece of code: //@version=5 strategy("MF chat3 Supertrend Strategy", overlay=true) import talib // SuperTrend Function atrPeriod…
0
votes
0 answers

Adding local files to git repo throws infinite error warning

When I am trying to add my local code to newly created git repo below error is thrown. https://i.stack.imgur.com/4o3VC.png warning: in the working copy of 'node_modules/@babel/runtime-corejs3/helpers/objectDestructuringEmpty.js', LF will be replaced…
0
votes
0 answers

Supporting different variations for reading file header (see Update)

I am trying read the header for a PGM file, which I found could have the follow variations: P2 255 255 255 or P2 255 255 255 or P2 255 255 255 right now, I got this code: std::ifstream file(file_name); std::string line_one, line_two,…
Kleber Mota
  • 8,521
  • 31
  • 94
  • 188
0
votes
0 answers

For loop knocking me for a loop. Whitespaces, new lines, unexpected behavior

I'm trying to teach myself bash and decided to try some simple loops. I made a script that prints a numbered list of the files in a directory along with their character count using different loops, which I put into functions just so I can…
Calibre
  • 13
  • 5
0
votes
3 answers

Regex: Match the text before the end of line

I have a file that looks like this: J6 INT-00113G 227.905 5.994 180 ~!@#$%&^) J3 INT-00113G 227.905 -203.244 180 12341341312315 U13 EXCLUDES -42.210 181.294 180 QFP128 U3 IC-00276G 5.135 198.644 90 …
theNoobGuy
  • 1,636
  • 6
  • 29
  • 45
0
votes
1 answer

Dired appears with 015 (Octal?)

Recently, my Dired listing in Emacs starting appearing with 015 at the end of each line: I'm not sure what brought it on. I had been making some changes with my Spacemacs layers but since then I've gone to a completely out-of-the-box Spacemacs…
AndyJ
  • 1,204
  • 3
  • 14
  • 28
0
votes
4 answers

splitlines() and iterating over an opened file give different results

I have files with sometimes weird end-of-lines characters like \r\r\n. With this, it works like I want: with open('test.txt', 'wb') as f: # simulate a file with weird end-of-lines f.write(b'abc\r\r\ndef') with open('test.txt', 'rb') as f: …
Basj
  • 41,386
  • 99
  • 383
  • 673
0
votes
1 answer

How do I create SAS fixed-format output containing end-of-line control characters?

I am using SAS's FILE statement to output a text file having fixed format (RECFM=F). I would like each row to end in a end-of-line control character(s) such as linefeed/carriage return. I tried the FILE statement's option TERMSTR=CRLF but still I…
user491609
  • 33
  • 2
  • 4
0
votes
4 answers

Is there a way to end the code without a new line after a repeat commnad that contains a new line inside it?

So i wrote a code to calculate the multiplication of two matrixes. The programm is doing its job by producing the correct outcome. I provide most of the output fuction below: for (i = 0; i < row; ++i) { for (j = 0; j < column; ++j) …
0
votes
1 answer

R markdown line break within a string (R Studio)

In regular R code I can do the following (when I put pointer at long_string and execute: long_string <- 'a b' So if I have a very long string then I can just hit Enter to split it and R Studio will understand. In R-markdown the above does not…
user1700890
  • 7,144
  • 18
  • 87
  • 183
0
votes
1 answer

C++ Read characters in only one line

I want to read only the characters from the first line of a file and then stop. The following code is not working in Codeblocks because the output file is empty. What did I do wrong? #include using namespace std; ifstream cin…
Abacus
  • 1
  • 1
0
votes
1 answer

End-of-Line Behavior and Git

I am new to Git. I've used GitHub a little before, but I quite recently started using Git itself locally on my system for version control. I am on a Windows system. However, I'm working with some files originally created on a Mac. As such, whenever…
0
votes
1 answer

Convert multiple files from every possible EOL to CRLF

I have files with every possible EOL imaginable. I want to normalize them in one go instead of doing them one by one as we are talking a few thousand. I know how to do them manually, so please don't explain that. I think all possible ones are, from…
0
votes
1 answer

How to add a closing bracket at end of each line using sed?

I'm trying to add } at end of each line using sed i use the following command: sed -i 's/$/}/g' test.txt But it adds } at end of the file instead. What is the correct command? I am using kali subsystem on windows 10 is that the problem? how can…
Rembo
  • 43
  • 1
  • 9
0
votes
1 answer

Ensure that all committed text files have only LF newlines

.gitattributes file with * text=auto followed by git add --renormalize . appears to be a good way to purge CRLF from repository. But still (according to https://git-scm.com/docs/gitattributes ) When the file has been committed with CRLF, no…
reducing activity
  • 1,985
  • 2
  • 36
  • 64
1 2 3
8 9