• Converting Linux newlines to Windows

    Home » Forums » AskWoody support » Windows » Windows – other » Converting Linux newlines to Windows

    Author
    Topic
    #481475

    Hi team!

    I’m sure this is really easy, if you know how!

    If I copy text from a web page and then paste it into a Windows program, the Windows program often fails to recognise newlines, showing effectively a single long line of text.

    I believe the main issue is that Windows looks for at the end of each line, whereas Linux based web servers only provide . There may also be an issue between ANSI, Unicode, and UTF-8 encoding.

    Over the years I’ve developed workarounds for most instances. Generally these involve pasting into a program that understands the newlines, then copying and re-pasting into the desired program. For instance, if the text won’t paste into Excel I might paste into Notepad first, then copy and paste into Excel. Conversely, if it won’t paste into Notepad it sometimes pastes into Word.

    So is there a quick, reliable way to copy text from a web page and paste it into Windows with Windows newlines (and preferably ANSI encoding)?

    Ian.

    Viewing 4 reply threads
    Author
    Replies
    • #1318579

      For command-line junkies such as myself, there are mirror programs TODOS.EXE and FROMDOS.EXE
      There is more information (and newer versions!) here.
      You may be able to manipulate it to suit your needs?

      BATcher

      Plethora means a lot to me.

    • #1318616

      Thanks BATcher While I’m also sometimes a command-line sort of person, I’m not sure if tofromdos.exe is quite the thing. Thanks anyway because it solves my other problem of reading my Linux server’s Apache log files on the Windows laptop I use to manage it. (currently I read them in Excel!)

      I posted this question just as the latest Windows Secrets landed in my inbox. And Lo! there is an article about GetPlainText, which is a great idea but doesn’t correct newlines. It does avoid passing stuff through Notepad though, so if the developer would add a tiny bit of functionality…

      Ian

    • #1318808

      If you want a gui program there are third party text editors such as PsPad & Notepad++ that will handle non-Windows files.

      Joe

      --Joe

    • #1318824

      Again, not quite what I was looking for, but I’ve also been looking for a free syntax-sensitive editor for PHP code for a while and PsPad looks pretty good. Will look at Notepad++ as well.

      Ian

    • #1318964

      Ian,

      So is there a quick, reliable way to copy text from a web page and paste it into Windows with Windows newlines (and preferably ANSI encoding)?

      Which browser do you use? I use Firefox with an extension called Copy Plain Text – EVE. I don’t seem to have the problem you experience when I use this. If you also use Firefox, you might wish to give it a try…

      BTW, I have used TextPad for years for (among others) PHP editing. It offers free syntax highlighting for PHP, Java, AutoIt and several other programming languages.

      Chris

    Viewing 4 reply threads
    Reply To: Converting Linux newlines to Windows

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: