Do you know what kind of machine they are going to open the txt file on ?
Do they make a request to your web app that causes the file to be generated ?
If so use that information to write either EndOfLine.Windows or EndOfLine.OSX to the text file
If you just use EndOfLine and the machine is running on linux then you get Unix line endings which Windows doesn’t treat as line endings
[quote=208772:@Jay Menna]It is not possible to know what kind of machine will be used.
Perhaps TXT is not the right format to store this… HTML Perhaps?[/quote]
If its part of "press a button the app generates the text file & then it downloads it immediately ?
The session should know if they are on a mac windows pc, etc and you could use that
But if its something your app generates with out such a request using the Windows line endings may suffice as many Mac apps will open that and translate them
What applications are they opening the files in ?
That might be useful to know as that may open other alternatives
Well then you’re in a tough spot since you dont know who is going to open it in what software or what platform.
Write Windows lines endings and hope Mac and Linux users have software that will auto translate those to their native ones is probably the best you can hope for.
However, those users may say that lines are double spaced
Next question - does it have to be a TEXT file ?
A PDF at least is cross platform & renders the same on all and you dont have to worry about line ending style.
Or an RTF which again is cross platform
But both of those require using software that can open them
And if its the kind of thing that people open & alter then save well … thats a new twist
I have never seen a Mac program getting Windows Text as double space since the System 9 or so. Besides, Windows text format is the de facto standard, and one would expect that format to be widely used in government.
Count yourself lucky then
I have
Write an app using Xojo and forget to replacelineendings when you read the data you get that effect in xojo
I have others that behave that way as well
An app like BBEdit will , if you have “translate line endings off”, not turn it into 2 lines but it turns it into one line + what appears to be a space (since its CR LF)
Textedit doesn’t have an option & always translates line endings
[quote=211571:@Norman Palardy]Count yourself lucky then
I have
Write an app using Xojo and forget to replacelineendings when you read the data you get that effect in xojo
I have others that behave that way as well
An app like BBEdit will , if you have “translate line endings off”, not turn it into 2 lines but it turns it into one line + what appears to be a space (since its CR LF)
Textedit doesn’t have an option & always translates line endings
Just dont be surprised if it happens[/quote]
I did not say it was impossible. I was referring to the standards apps precisely like TextEdit, Pages, etc. All the case you cited are not exactly user’s run of the mill.
Many apps will auto translate - I didn’t disagree there
I was just pointing out there are those that won’t because it may not be the right thing to do
BBEdit isnt exactly an unknown app
[quote=211575:@Norman Palardy]Many apps will auto translate - I didn’t disagree there
I was just pointing out there are those that won’t because it may not be the right thing to do
BBEdit isnt exactly an unknown app[/quote]
Users <> Developers. BBEdit or Xojo are not really the kind of apps that will be used in the setting described by the OP.
My point was about regular users. Not power ones and even less programmers.
Apple has worked real well at making sure Windows originated files can be opened transparently by regular users. I open daily Windows documents with Pages or Numbers, and it is really good.