Jump to content

Lost indentation in Notepad. - Problem solved.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Tom Brown

Tom Brown

    Newbie

  • Members
  • Pip
  • 2 posts
Hi All

I've written some HTML and CSS files using a text editor called Leafpad which I downloaded using Synaptic Packet Manager on a box running PCLinuxOS. Leafpad looks very much like Windows Notepad and is very quick and easy to use. I indented the script - as one does - to make the files understandable. I have need to edit these files at a different location on a PC running Windows XP, so I tried to use Windows Notepad. However, when I open the files, I have lost all the layout and indentation. The text is just one large block of text. When checking back on my Linux box. If I open the files in Linux text editor KWrite, the indentation is still there. Why have I lost the indentation when using Windows Notepad.

Regards

Tom

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Notepad doesn't understand Unix/Linux line-break and tab indention character sets. Trying opening this in Wordpad or download a text editor like Notepad2 (which is free).

#3
Tom Brown

Tom Brown

    Newbie

  • Members
  • Pip
  • 2 posts
Jordan

Thank you very much for the prompt response. I'll try both your suggestions.

Thanks again.

Tom

#4
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Yes I saw that quite sometimes.. I just openit with wordpad, and save it in wordpad.. notepad than should work fine.

#5
GMailGuy

GMailGuy

    Learning Programmer

  • Members
  • PipPipPip
  • 60 posts
Why is that? Is it because of the ASCII values or something? Aren't they supposed to be the same on all OSes?

#6
Guest_Jordan_*

Guest_Jordan_*
  • Guests
It isn't the ASCII values but the line-breaks. MS looks for carriage returns (\r) instead of new lines (\n) which it should. To fix the problem you can convert "\n" to "\r\n".

You can use this website to convert your files from Unix to Dos.

#7
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Really? So how come that Wordpad still shows it correctly? isn't it still MS?