@mirco69 I do not understand your problem with text files with line ending in Unix/Linux format.
Do you just open a Unix file and close it without making any change on file contents by yourself and saving the file?
UltraEdit does not silently convert the file from Unix to DOS/Windows just because of opening and closing it without any user modification and save.
The
temporary file created
on open from the original file with just
\n (Unix) or with just
\r (Mac < OS X) as line ending is converted automatically to a text file with
\r\n on selected radio option
Automatically convert to DOS format in configuration. The configuration setting is ignored by UltraEdit if the file is opened without usage of a temporary file as UltraEdit 2024.1.0.36 does not modify the file on storage media just because of opening it in UltraEdit. That would not be possible at all if the read-only attribute is set or the user has just the permissions to read the file but not write it as typical for large log files or CSV files.
Text selected in the file opened with usage of a temporary file and with automatic conversion from Unix/Mac to DOS/Windows is copied to clipboard with
\r\n and UltraEdit macros and scripts can be coded to recognize just
\r\n as line ending and write lines into the file with always
\r\n which makes it easier writing such macros and scripts. The macro/script should be used in this case only on small/medium files which are opened with usage of a temporary file. If the macro/script should work also on large/huge files opened without usage of a temporary file for more efficiency, the macro/script must recognize first the line termination type and use it on making modifications on the file directly on original file on storage media.
The check box option
Save file as input format (Unix/Mac/DOS) is important
on save of a file. I have checked this option as it results in saving the file with original line ending format as it was detected by UltraEdit on opening the file. I edit often Unix files in UltraEdit on Windows which should remain Unix files after my edits in UltraEdit. The conversion to
\r\n is done in this case only temporarily by UltraEdit on the created temporary file. The original file overwritten on save with the contents of the temporary file has the line endings in original format. (Note: Some commands like the command
sort result in a permanent change to DOS/Windows line ending of the temporary file despite this option.)
The temporary file with DOS/Windows line terminators is saved with
\r\n on having
not checked this check box option. The temporary file simply replaces the original file without a conversion of the newline characters back to Unix or Mac as the originally opened file has had until the file save.
Important is that the automatic conversion from just
\n or just
\r is only done temporarily on file open on copying the original file to temporary file for the temporary file. The file on storage media is not changed immediately and also not permanently as long as the user does not make at least one change on file contents and saves the file. The user must explicitly do a conversion from Unix/Mac to DOS with executing this command. As the temporary file is already with DOS/Windows line ending, the temporary file is not modified in this case, but UltraEdit marks the file now as modified by the user and ignores the original line ending format as determined on opening the file. The user explicitly converted the file now to DOS/Windows and UltraEdit honors that on next file save.
The text editor UltraEdit cannot be used without a macro or script for converting Unix/Mac files to DOS/Windows files by just opening and next closing the Unix/Mac file without doing any modification on file contents and do a file save independent on the configuration settings. A file not modified by the user is not silently modified by UltraEdit on storage media.
There is the configuration setting
Status bar shows original line terminator format (on disk). This check box option should be checked to see in the status bar always displayed how the file is currently stored on disk (storage media) respectively would be saved by UltraEdit on next save after a file contents change by the user. I have checked this option too.
Summary of my configuration:
- Automatically convert to DOS format is selected.
- Save file as input format (Unix/Mac/DOS) is checked.
- Status bar shows original line terminator format (on disk) is checked.
- Large file threshold (KB) is configured by me with 4096 (4 MiB).
- Open file without temp file but prompt for each file is selected.
I can see therefore
Unix in the status bar on opening a text file with just
\n as line termination on file having less than 4 MiB or if a open a file with 4 MiB or more and decide on prompt to open the file nevertheless with usage of a temporary file. The created temporary file displayed in the document window in UltraEdit is with DOS/Windows line endings. Even if I make changes and insert lines with
\r\n, the status bar still shows Unix informing me that on next file save UltraEdit converts all
\r\n in the temporary file back to just
\n on overwriting the original file. The temporary file is kept with
\r\n. Only the original file is written with just
\n on save. The exception is running a sort on some lines or the entire file. In this case the status bar changes from
Unix to
DOS indicating that UltraEdit will save the file now as DOS/Windows file although in most cases not wanted by me. I must convert the sorted file back to Unix before next save. I reported this issue years ago. But there is no change up to now (UE v2024.1.0.36). There are a few other commands which change also the line ending type permanently to DOS/Windows although I prefer always saving a file in original format as long as not running manually the Unix/Mac to DOS conversion command (or using save as with selecting a different line ending format).