![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Can we use sed for this?
Yesterday I suggested this as a reply to a post, but when I sat to do it myself I was having problems!
![]() I want to convert a UNIX text file to DOS and vice versa. I mean I want to convert a single LF to CRLF and vice versa. Can I do it with sed? If not, how else can I do it? LF - line feed - octal 012 CR - carriage return - octal 015 I know this is not much of practical use (as we can do these conversions using ascii mode in ftp ) - just curious. Cheers! Vishnu. |
|
|||||
|
just use mail or ftp with ascii
I am not sure what you mean. A UNIX text file IS a plain text doc in WINDOWS. If you want to format it, wait until you open it with MS WORD and format then.
I am sure there is a way to format it beforehand, but it slips my mind just now. However, you can just email the file to your PC from the unix box. or use ftp with the ascii setting and you should have NO problems! mailx -s "myfile" me@myhost.com < myfile.txt Should be that easy! ![]() |
|
||||
|
See also
Removing the ^M character in VI
And there was a strange character(^M) been added automatically in UNIX Somewhere on this board you can find the sed sequense to. Sorry i did not find it |
|
||||
|
Quote:
but the DOS delimiter is "\r\n" or "\o015\o012" or CRLF Cheers! Vishnu. Last edited by Vishnu; 11-04-2002 at 07:52 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|