Line-ending signifies end of line. Depending on operating system line-endings are different.
Questions tagged [line-endings]
516 questions
0
votes
1 answer
How to end a statement in Ruby
I have code like
word.include?("test") ? @test = word : #do nothing
My issue is that rails expects something after the colon and treats the next line of code as if it's part of the conditional statement above. I know I can use a regular if end…

Steve
- 4,446
- 7
- 35
- 50
0
votes
1 answer
Specify line.separator as a compiler setting?
As suggested by this answer:
You can call
System.setProperty("line.separator", "\r\n");
in order to set the system property inside your code.
it is quite easy to make a Java program output the desired line endings. However, I see no reason why…

Christian Neverdal
- 5,655
- 6
- 38
- 93
0
votes
1 answer
Using Windows line endings in Perl6::Form
I'm using Perl6::Form to generate a table and output it to a text file. No matter what I do, it seems, I can't output Windows line endings. I've tried local $OUTPUT_RECORD_SEPARATOR = "\r\n"; I've tried appending \r\n to my format strings. No…

Aurelia Peters
- 2,169
- 1
- 20
- 34
0
votes
2 answers
Visual Basic- "IF" doesn't end
If My.Computer.FileSystem.FileExists("pack/locale_ro.epk") Then My.Computer.FileSystem.DeleteFile("pack/locale_ro.epk")
PB_GSM.Value = 10
If My.Computer.FileSystem.FileExists("pack/locale_ro.eix") Then…
0
votes
1 answer
Create convert_line_endings function
I have a configuration file that is supposed to have \r\n line ending style, and I want to include the code in my program to check and correct the format.
Existing code:
int convert_line_endings(FILE *fp)
{
char c = 0, lastc = 0, cnt = 0;
…

BenjiWiebe
- 2,116
- 5
- 22
- 41
0
votes
2 answers
Linux replace ^M$ with $ in csv
I have received a csv file from a ftp server which I am ingesting into a table.
While ingesting the file I am receiving the error "File was a truncated file"
The actual reason is the data in a file contains $ and ^M$ in end of the line.
e.g…

Arun Padule
- 681
- 1
- 6
- 7
0
votes
2 answers
Can't seem to write a valid .ics file?
I need your help. I'm writing a iCal .ics File-format with a php function.
If I open the .ics file with iCal it says the application says: "Calendar can’t read this calendar file. No events have been added to your calendar."
However if I validate…

matt
- 42,713
- 103
- 264
- 397
0
votes
2 answers
How does line ending effect in coding?
Why do line ending differ from platform to platform? Even why is there term like line ending in programming?
I prefer saving my codes in Unix/Linux format, even if I'm on Windows. Am I missing anything by not saving it in Windows or MacOS format?…

Santosh Kumar
- 26,475
- 20
- 67
- 118
0
votes
1 answer
Any format to UNIX end line format recursively
I have two different script to change DOS2UNIX and MAC2UNIX endline format
DOS2UNIX: perl -pi -e 's/\r\n/\n/;' < dos1.txt > dos2.txt
MAC2UNIX: perl -p -e 's/\r/\n/g' < mac1.txt > mac2.txt
Is there anyway get these functionalities in a signle command…

Mohamed Saligh
- 12,029
- 19
- 65
- 84
-1
votes
1 answer
How to fix the line ending style (either CRLF or LF) in Python when written a text file?
I have the following little program in Python
from pathlib import Path
filename = Path("file.txt")
content = "line1\nline2\nline3\n"
with filename.open("w+", encoding="utf-8") as file:
file.write(content)
After running it I get the following…

fgalan
- 11,732
- 9
- 46
- 89
-1
votes
1 answer
How to configure git line endings simple and minimal?
my assumption is that only in batch files windows line endings should be allowed. Everywhere else should be used the git internal mechanic to recognize binary files and all other text files should enforce linux file endings. Can this be configured…

jan
- 2,741
- 4
- 35
- 56
-1
votes
1 answer
Can't disable autocrlf using .gitattributes
I have a directory called "test" in which I've placed some text files with various line endings. The trouble is Git for Windows insists on converting the file with LF line endings to CRLF because autocrlf is enabled.
To try and get around this I've…

Simon Morgan
- 2,018
- 5
- 23
- 36
-1
votes
1 answer
PHP Files Throw Parse Errors (ex: T_STRING) After Migrating
This is a weird one, and something I've never run into before.
I'm deploying to a vvv (Varying Vagrant Vagrants) box from PHPStorm, and the project is a wordpress site.
Frequently, when files are moved over, after reloading the site, I get a PHP…

slothluvchunk
- 382
- 2
- 9
-1
votes
1 answer
Git line endings after normalization: Good or bad practices?
I've read a lot about git's line ending normalization and already learned that .gitattributes seems to be the way to go. But I read many pros and cons for line ending normalization in general, especially with windows. So for me the question is...
Is…

Michael Aigner
- 4,820
- 4
- 21
- 33
-1
votes
1 answer
Eclipse TM Terminal: ESP32 serial terminal
I try to use Eclipse TM Terminal to communicate with my ESP-32. However, at some point it starts not shifting to line beginning. It looks like this:
.
Changing Line ending for UART output don't change anything. How can I get this working?
UPD:…

val - disappointed in SE
- 1,475
- 3
- 16
- 40