Hi,
I use Textpad at home to write my Java files, but at university we use Linux. When I open the files I have saved at home using Textpad at university using emacs in Linux, the end of each line where I pressed [return] has ^M^M. How can I get rid of this, please!!!
This is very important. I dont have linux at home, and dont have Windows at university. So I need to be able to open my files saved in Textpad at university using Linux.
Thanks.
Usmani
.java File saved in Textpad appears funny-ish in emacs
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- talleyrand
- Posts: 624
- Joined: Mon Jul 21, 2003 6:56 pm
- Location: Kansas City, MO, USA
- Contact:
You are seeing the difference between unix and PC line termination. Unix uses ... carriage return while DOS has carriage return + line feed. You have a few options. The first is to edit the Java class preferences in TextPad and set the file type to use Unix. The next option is to transfer your files via FTP to the linux machine in ASCII mode and I believe that will make the conversion for you. Yet another option is to run the utility dos2unix to make the funny characters go away prior to editing. Final option is to do a search and replace in the editor for the ^M. And I'm too rusty right now to remember what the key strokes were to get that to show up in vi. Finally, check your emacs documentation. I believe that OS probably has that functionality built into it.
I choose to fight with a sack of angry cats.