Looking for a MS program that will convert text from Linux

W

W. eWatson

I'd like to be able to print a text file from Linux on Win7. Is there a
program that will do it?
 
J

John Williamson

W. eWatson said:
I'd like to be able to print a text file from Linux on Win7. Is there a
program that will do it?
It depends which program was used to create the text file.

If it's plain text, Wordpad should open and print it.

Other than that, Libre Office is free and available for both platforms,
and will open many different text formats.
 
N

Nil

I'd like to be able to print a text file from Linux on Win7. Is
there a program that will do it?
Your question is vague, but I'll go ahead and make assumptions...

If you're talking about converting line termination characters, almost
any decent text editor will do that (Notepad doesn't count.) Notepad++,
Editpad Lite, Programmers File Editor, Crimson Editor, are some
examples.

Otherwise, printing is printing, and it doesn't make any different
whether the text file came from Linux or Windows.
 
W

W. eWatson

It depends which program was used to create the text file.

If it's plain text, Wordpad should open and print it.

Other than that, Libre Office is free and available for both platforms,
and will open many different text formats.
Fortran 90. Ah, it works fine in WordPad. Thanks.
 
V

VanguardLH

Nil said:
Your question is vague, but I'll go ahead and make assumptions...

If you're talking about converting line termination characters, almost
any decent text editor will do that (Notepad doesn't count.) ...
But, as I recall, WordPad will do the conversion. When a *NIX-generated
text file is hard to read in Windows because it lacks one of the newline
characters, I open it in WordPad to read it. Just viewing in WordPad
won't do a conversion but using Save [As] should (but select Text
Document as the filetype instead of RTF if you still want it a text
document).

That's how WordPad works under Windows XP. I don't have an example
*NIX-generated text doc right now but then eWatson should be able to
test very quickly since she obviously has some file in mind.
 
P

Paul

W. eWatson said:
I'd like to be able to print a text file from Linux on Win7. Is there a
program that will do it?
If you open in Wordpad and immediately save (not changing the "text" mode
as shown in the save dialog box or anything), Wordpad will change from Linux
termination to MSDOS termination.

Now, if after doing that, you close Wordpad and then open with Notepad,
all should be well. You then have the choice of printing from Wordpad
or Notepad, depending on which is your favorite built-in.

*******

I've also used a pair of programs called "unix2dos" and "dos2unix". They
were in a MinGW folder in my Xilinx tree. I used the unix2dos.exe program,
for bulk transformation of a Firefox source download, where all the files
had the wrong terminations and were driving me nuts when opening with Notepad.

http://oldwiki.mingw.org/index.php/mingw-utils

If you're still in Linux, you can use Gedit (part of Gnome) and you have
options in there, to save for a particular target. If you want Windows line
endings, you can solve the problem on that end, before transferring the files
over.

You could also, potentially, solve it by using "ascii" mode transfer with an
FTP command, but not too many people do that sort of stuff any more. It's
too hard to convince your favorite distro to use something as security
challenged as FTPD. Whereas on MacOSX, I can temporarily enable FTP with a
single click of a button, and do stuff I need to do, then shut it off again.
Three cheers, for thinking developers...

There are a ton of ways of doing it, but some care should be taken. There
are actually many stupid variations on the basic <cr><lf> issue, some of
which the file gets damaged during the conversion (i.e. format changes
you won't like). So sometimes, these translations go wrong. It all depends
how devious the provider of the file was. If the file is coming from a
text editor on the other platform, chances are good you'll never have a
problem. But I've had files where irreversible changes were made (requiring
hand edit), if the original file got replaced by the tool changing the line
endings. I don't have enough experience with Gedit, to know yet whether it
can be fooled into doing something stupid. Same goes for "unix2dos" - I've
only ever used it the one time. When I used "unix2dos", I used another script
to prepare a .bat file, with separate calls for each file to be converted.
So the script did the job of recursing down the tree, and picking out
all the text files (.cpp, .c, .h and so on)

Paul
 
N

Nil

But, as I recall, WordPad will do the conversion. When a
*NIX-generated text file is hard to read in Windows because it
lacks one of the newline characters, I open it in WordPad to read
it. Just viewing in WordPad won't do a conversion but using Save
[As] should (but select Text Document as the filetype instead of
RTF if you still want it a text document).

That's how WordPad works under Windows XP. I don't have an
example *NIX-generated text doc right now but then eWatson should
be able to test very quickly since she obviously has some file in
mind.
I just tried it and you're right, Wordpad converts a Unix format text
file to DOS/Windows. It doesn't tell you that it's doing it, which
isn't good, but it works.
 
J

James Silverton

But, as I recall, WordPad will do the conversion. When a
*NIX-generated text file is hard to read in Windows because it
lacks one of the newline characters, I open it in WordPad to read
it. Just viewing in WordPad won't do a conversion but using Save
[As] should (but select Text Document as the filetype instead of
RTF if you still want it a text document).

That's how WordPad works under Windows XP. I don't have an
example *NIX-generated text doc right now but then eWatson should
be able to test very quickly since she obviously has some file in
mind.
I just tried it and you're right, Wordpad converts a Unix format text
file to DOS/Windows. It doesn't tell you that it's doing it, which
isn't good, but it works.
Have you tried the free PC program PureText? It removes most formatting
and decorations from copies of web pages. I don't have a Linux computer
available to try it.
 
Y

Yousuf Khan

I'd like to be able to print a text file from Linux on Win7. Is there a
program that will do it?
If it's a pure text file, rather than a formatted word processing file,
then you can run it through Linux's command-line utility called
"unix2dos" before sending it to Windows. For example:

unix2dos < linux.txt > windows.txt

The reverse is "dos2unix".
 
Y

Yousuf Khan

If it's a pure text file, rather than a formatted word processing file,
then you can run it through Linux's command-line utility called
"unix2dos" before sending it to Windows. For example:

unix2dos < linux.txt > windows.txt

The reverse is "dos2unix".
Sorry the actual syntax is just:

dos2unix linux.txt

You'll then have to rename it separately to "windows.txt" if you want.

Yousuf Khan
 
C

Char Jackson

If it's a pure text file, rather than a formatted word processing file,
then you can run it through Linux's command-line utility called
"unix2dos" before sending it to Windows. For example:

unix2dos < linux.txt > windows.txt

The reverse is "dos2unix".
It seems easier to just open it in Wordpad. I've been doing it that
way since forever.
 
K

Ken Blake

Have you tried the free PC program PureText? It removes most formatting
and decorations from copies of web pages.

I forgot who recommended this a few weeks ago (was it you?), but I
tried it then, liked it, and have been using it ever since. So I'll
add my endorsement to yours.
 
J

James Silverton

I forgot who recommended this a few weeks ago (was it you?), but I
tried it then, liked it, and have been using it ever since. So I'll
add my endorsement to yours.
It might have been me but I'll just mention again that you can set up a
key to do a paste without format after copying: I use CRTL-0.
 
B

BillW50

In
James said:
It might have been me but I'll just mention again that you can set up
a key to do a paste without format after copying: I use CRTL-0.
I have used PureText for years and it does the job very well. Although a
lot of clipboard managers also has this feature built in. So I normally
use those instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top