LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-12-2007, 02:51 PM   #1
peedaro
LQ Newbie
 
Registered: Oct 2007
Posts: 19

Rep: Reputation: 0
file encoding..??


hi..i saved a document in openoffice.org...copied it onto a cd..
and pasted this document in xp..it opened in MSWORD..
BUT IT IS IN SOME ENCRYPTED fashion..
which option do i hafta click to get my original document..??
i tried all three
windows(default) msdos other encoding
none of these will decrypt it..
 
Old 11-12-2007, 03:42 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Which document format did you save it as? You can save it as *.rtf (rich text format) or as *.doc from OpenOffice and those should open just fine in MS Word. If you used the standard open office format, however, Word can't open it.
 
Old 11-13-2007, 12:11 AM   #3
peedaro
LQ Newbie
 
Registered: Oct 2007
Posts: 19

Original Poster
Rep: Reputation: 0
The document was copied with *.sxw extension from home directory..
as u said i saved it in *.rtf as well as *.doc extension..
the same problem persists..
The document is a source code in c..
is there any other way..
 
Old 11-13-2007, 07:51 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
In OpenOffice, are you using "save as" and then selecting--e.g.--MS Word 2000/XP? I ask this because you imply that you get the same results with the .sxw and .doc extensions. This would happen if you were simply changing the extensions.

Also, if the default extension is .sxw, it means you are using a fossil version of OOo---I suggest upgrading to 2.X
 
Old 11-13-2007, 08:23 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Why are you transferring C sourcecode as a word processing document? C is plain ASCII. All you need to do it change the end-of-line encoding and the file will be quite OK to open in notepad on Windows.

If you FTP the file between machines in ASCII mode, the end of line encoding will be changed automatically.

If you cannot use FTP for some reason, you can use a program like fromdos (and it's counterpart, todos), which you can run on the source file before copying it to the Windows machine.
 
Old 11-14-2007, 09:26 AM   #6
peedaro
LQ Newbie
 
Registered: Oct 2007
Posts: 19

Original Poster
Rep: Reputation: 0
i hope i dont sound stupid..how do i actually change the end of line encoding...should i include it in my source code..??
 
Old 11-18-2007, 12:04 PM   #7
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
The programs fromdos and todos convert files from and to the dos end-of-line encoding. For example:

You have your sourcecode file, maybe called myfile.c. You have edited it on your windows machine, maybe in notepad or Visual DevStudio or whatever... You want to transfer it to your Linux machine, so you burn a CD with the file on it.

On the destination machine (a Linux box), just install fromdos, and run it on the file after copying the file to your hard disk. It is a command line tool, so lets assume you have copied the file to your home directory... just open a terminal and use the command:
Code:
fromdos myfile.c
(Of course, you will need to have installed the fromdos program to do this).

That's it - the fromdos program modified the file so that it has unix-style line endings.

todos should be used if you edit the files on your unix box and burn a CD for transferring the files to Windows machine.
 
Old 11-20-2007, 01:20 AM   #8
peedaro
LQ Newbie
 
Registered: Oct 2007
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks A Lot..it Opened In Notepad...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to determine file encoding maxmil Linux - General 3 09-13-2008 03:26 AM
finding the encoding of a file mike_stlouis Linux - Newbie 2 11-01-2007 08:47 AM
file encoding yuubouna Linux - General 3 01-16-2007 01:47 AM
determine encoding type of a file (ie - UTF-8) chovy Linux - Software 1 04-03-2006 12:46 AM
encoding for ReiserFS file names? uselpa Slackware 1 11-15-2005 04:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration