FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 11-08-2011, 09:34 PM
Nils Kassube
 
Default editing text files

Noah wrote:
> okay I am having issues correcting the ^M and line feeds of a text
> file. Let me explain. I transfered a text file that a friend sent
> me from a windows machine. Now when I 'less' the file there are no
> new lines appearing and '^M' appears where I would expect the new
> line to appear.

> What I can do to fix this problem? Is there an option in emacs or is
> there an option from the shell?

I don't speak emacs, so here is a shell command instead:

cat old.txt | tr '
' '
' >new.txt


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-08-2011, 09:38 PM
Hal Burgiss
 
Default editing text files

On Tue, Nov 8, 2011 at 5:19 PM, Noah <noah-list@enabled.com> wrote:


Hi there,



okay I am having issues correcting the ^M and line feeds of a text file.

Let me explain. *I transfered a text file that a friend sent me from a windows machine. *Now when I 'less' the file there are no new lines appearing and '^M' appears where I would expect the new line to appear.





when I emacs the file - the file appears to be formatted correctly. emacs claims its formatting is *"Mac" and "Text" *I dont see any ^M markings in the emacs editor and all the new lines are where I expect them to be.





What I can do to fix this problem? *Is there an option in emacs or is there an option from the shell?


There is also shell commands *... dos2unix, which I think Ubuntu has as fromdos that will rewrite the files. I don't recall offhand what package these are in.

*--
Hal

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-09-2011, 01:33 AM
Knute Johnson
 
Default editing text files

On 11/8/2011 2:38 PM, Hal Burgiss wrote:

On Tue, Nov 8, 2011 at 5:19 PM, Noah <noah-list@enabled.com
<mailto:noah-list@enabled.com>> wrote:

Hi there,

okay I am having issues correcting the ^M and line feeds of a text file.
Let me explain. I transfered a text file that a friend sent me from
a windows machine. Now when I 'less' the file there are no new
lines appearing and '^M' appears where I would expect the new line
to appear.

when I emacs the file - the file appears to be formatted correctly.
emacs claims its formatting is "Mac" and "Text" I dont see any ^M
markings in the emacs editor and all the new lines are where I
expect them to be.

What I can do to fix this problem? Is there an option in emacs or
is there an option from the shell?


There is also shell commands ... dos2unix, which I think Ubuntu has as
fromdos that will rewrite the files. I don't recall offhand what package
these are in.
--
Hal




I just loaded it, it is in it's own package.

--

Knute Johnson

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 11-09-2011, 05:22 PM
Nicolas Kovacs
 
Default editing text files

Le 08/11/2011 23:19, Noah a écrit :

What I can do to fix this problem? Is there an option in emacs or is
there an option from the shell?


Check out the 'dos2unix' and 'unix2dos' commands. Work like a charm.

Cheers,

Niki

--
Microlinux - Solutions informatiques 100% Linux et logiciels libres
7, place de l'église - 30730 Montpezat
Web : http://www.microlinux.fr
Mail : info@microlinux.fr
Tél. : 04 66 63 10 32

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 02:52 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org