You are here: PSPad forum > English discussion forum > Line endings not maintaining

Line endings not maintaining

Goto Page: Previous1 2

#11 Re: Line endings not maintaining

Posted by: pspad | Date: 2018-07-26 11:30 | IP: IP Logged

In my opinion we should start what is source of your file.
Local file or downloaded from FTP?
It's genereted by some software?

Options: Reply | Quote | Up ^

#12 Re: Line endings not maintaining

Posted by: trainee.GED5 | Date: 2018-07-26 11:41 | IP: IP Logged

Generated from EXCEL as a text file and then I converted it to Unicode.
The file is like Product Number and some long text in arabic.

Options: Reply | Quote | Up ^

#13 Re: Line endings not maintaining

Posted by: vbr | Date: 2018-07-26 12:05 | IP: IP Logged

it seems, the text contains a mix of line endings, most editors I tried display the text the same like PSPad, only windows notepad shows fewer longer lines like in your sample.

cf. the displayed file in Scite editor ( ), which keeps the lineendings and does not unify them like PSPad and some other editor

windows notepad seems to only accept the windows standard line ending CRLF and ignores lone LF, hence there are no line breaks for single LFs in the file.

Other editors support multiple formats from othe different OSes: CR or LF or CRLF and interpret them as well; in that case there are linebreaks also at LF.
I Can't verify the correct display of the text, there might be other problems, e.g. with script direction LTR - RTL and possibly the encoding.

If there is the right content, only with extra LF marks at some positions I recommend unifying this to some suitable form - e.g. replace LF with spaces or similar and keep only one type of line endings - e.g. the current CRLF, if you use windows.

E.g. in Scite, you can replace these characters using CTRL+H and checking the item [\r\t] - transform backslash expressions
then you can replace e.g.
(this will remove the LF, if there should be a space or another character, just add it as the replacement string.)
Additionally, you can also replace
to get usual windows line endings, but it might not be needed.

The unified file can then be opened in PSPad normally - containing lines with numbers a tab and quoted text.

As far as I know, this conversion itself cannot be currently done with PSPad (or maybe using hex editor somehow (?)), as the line endings are converted and unified internally, they cannot be manipulated this way as there are usually single-style line endings in whole text.
It is possible that you can do this in some other editor too, if this mixed file content could be created ...


Options: Reply | Quote | Up ^

#14 Re: Line endings not maintaining

Posted by: pspad | Date: 2018-07-27 07:02 | IP: IP Logged

If you generated it from excel, check the code please. It looks like you include additional 0A (10 ASCII) char before " on the end of lines.

Options: Reply | Quote | Up ^

Goto Page: Previous1 2

Editor PSPad - freeware editor, © 2001 - 2019 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR