From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Brehl, Blake" Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: a way to add the windows return character Date: Fri, 14 Mar 2008 15:19:18 -0700 Message-ID: <06919C2CEC2A8D46A394A43403A52CFD778608@moh-exc-006.main.intgin.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1205533192 23062 80.91.229.12 (14 Mar 2008 22:19:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Mar 2008 22:19:52 +0000 (UTC) To: tru64-unix-managers@ornl.gov Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Fri Mar 14 23:20:20 2008 Return-path: Envelope-to: gotm-tru64-unix-managers@gmane.org Original-Received: from sws1.ornl.gov ([160.91.1.101]) by lo.gmane.org with smtp (Exim 4.50) id 1JaIGB-0001xi-Bz for gotm-tru64-unix-managers@gmane.org; Fri, 14 Mar 2008 23:20:19 +0100 Original-Received: (qmail 26834 invoked by uid 49509); 14 Mar 2008 22:19:34 -0000 Original-Sender: tru64-unix-managers-owner@ornl.gov Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 26824 invoked by uid 49501); 14 Mar 2008 22:19:34 -0000 Original-Received: from 160.91.4.110 by sws1 (envelope-from , uid 49491) with qmail-scanner-1.25 (clamdscan: 0.83/743. spamassassin: 3.0.2. Clear:RC:0(160.91.4.110):SA:0(-2.6/5.0):. Processed in 0.809659 secs); 14 Mar 2008 22:19:34 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 Original-Received: from emroute3.ornl.gov (160.91.4.110) by sws1.ornl.gov with SMTP; 14 Mar 2008 22:19:33 -0000 Original-Received: from emroute3.ornl.gov ([127.0.0.1]) by emroute3.ornl.gov (PMDF V6.3-x14 #31501) with ESMTP id <0JXQ00AEPRCKIN@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 14 Mar 2008 18:19:33 -0400 (EDT) Original-Received: from CONVERSION-DAEMON.emroute3.ornl.gov by emroute3.ornl.gov (PMDF V6.3-x14 #31501) id <0JXQ00C01RCKY7@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 14 Mar 2008 18:19:32 -0400 (EDT) Original-Received: from VIRUSCAN-DAEMON.emroute3.ornl.gov by emroute3.ornl.gov (PMDF V6.3-x14 #31501) id <0JXQ00C02RC8XZ@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 14 Mar 2008 18:19:32 -0400 (EDT) Original-Received: from moh-exc-006.main.intgin.net (moh-exc-006.main.intgin.net [12.151.36.183]) by emroute3.ornl.gov (PMDF V6.3-x14 #31501) with ESMTP id <0JXQ00BFYRC71U@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Fri, 14 Mar 2008 18:19:20 -0400 (EDT) X-Envelope-from: Blake.Brehl@anritsu.com X-MIMEOLE: Produced By Microsoft Exchange V6.5 Thread-Topic: SUMMARY: a way to add the windows return character Thread-Index: AciGA29p3eXocbQ4T9OmaIQL/48W7QAHOFaQ Content-class: urn:content-classes:message X-Spam-Virus: No X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on spam3.ornl.gov X-Spam-Level: X-Qmail-Scanner-MOVED-X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 X-MS-Has-Attach: X-MS-TNEF-Correlator: Xref: news.gmane.org gmane.os.tru64.managers:9293 Archived-At: Thank you for the several replies, I was successful using Edward's. They are: _____________________ >From Graham Allan If I understand the question rightly, then yes, there are some tools delivered with mtools which can do this (I think some version of mtools comes with tru64). dos2unix and unix2dos might be what you need. _____________________ >From Edward White do you mean convert a unix text file to a dos/win text file? awk '{sub(/$/,"\r\n");print}' somefile > newfile puts a crlf at the end of each line. _____________________ >From Dr. Thomas P. Blinn I would use "sed", the stream editor. Just replace the end of each line with a return: sed "s/$/\m/" $somefile > $newfilename should work if I recall correctly, although I've have to double-check the sed reference page to make sure that it will interpret the \m as meaning to use a carriage return. And you could enter a carriage return into the script as you type it with most editors using the control-v control-m type of sequence, so if you need to you can put the carriage return directly into the sed pattern literal. Alas, I don't have a handy UNIX system on which to try this out or check the reference page. ______________________ >From Jay Leafey There is an online utility you can use to convert UNIX-format, (i.e.=20 NL-terminated) files to DOS/Windows format (CR+LF) available at=20 http://www.iconv.com/unix2dos.htm. There is also a Windows-based program to perform the same conversion,=20 available at http://www.iconv.com/unix2dos.htm. In addition, there is a pair of programs available in several different=20 Linux distributions named dos2unix and unix2dos that are written in=20 reasonably-portable C that should be pretty easy to port to Tru64. Hope that helps! ________________________ >From J.A. Guterrez alias frommac=3D"tr '\015' '\012'" alias tomac=3D"tr '\012' '\015'" alias fromdos=3D"tr -d '\015'" alias todos=3D'awk "{printf(\"%s\r\n\",\$0)}"' ________________________ It's a great list! Thanks for the assistance. Blake -----Original Message----- From: Brehl, Blake=20 Sent: Friday, March 14, 2008 11:44 AM To: Tru64 Mailing List (tru64-unix-managers@ornl.gov) Subject: a way to add the windows return character Hello Admins,=20 =20 it there a way to take a file and add the backspacing or windows return characters, with UNIX commands. It'd be the opposite of using "col" filtering =20 cat $somefile | col -b > $newfilename =20 which strips them out. We're mostly using ksh. =20 TIA, Blake =20 =20 Tru64UNIX V5.1Asp1 GS80 =20 Blake Brehl Sys Admin/DBA Anritsu Company United States Morgan Hill, CA blake.brehl@anritsu.com