From owner-freebsd-questions Tue Jan 12 04:17:59 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA10978 for freebsd-questions-outgoing; Tue, 12 Jan 1999 04:17:59 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from house.key.net.au (house.key.net.au [203.35.4.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA10879 for ; Tue, 12 Jan 1999 04:17:38 -0800 (PST) (envelope-from keith@apcs.com.au) Received: (from uucp@localhost) by house.key.net.au (8.8.8/8.8.8) id XAA25933; Tue, 12 Jan 1999 23:15:48 +1100 (EST) (envelope-from keith@apcs.com.au) Received: from well.apcs.com.au(203.35.4.19) via SMTP by mailgw.key.net.au, id smtpdK25931; Tue Jan 12 23:15:47 1999 Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit MIME-Version: 1.0 In-Reply-To: <001401be3d39$ce142710$0a1e21cb@superbruce.hotmix.com.au> Date: Tue, 12 Jan 1999 23:15:48 +1100 (EST) Reply-To: keith@apcs.com.au Organization: Australia Power Control Systems P/L From: Keith Anderson To: Craig Beasland Subject: RE: replacing ^M in vi Cc: FreeBSD Questions List Cc: FreeBSD Questions List , charon@freethought.org Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi compile this just for fun to remove ^M #include main () { FILE *fp , *fp_out ; int c, lastc; char filename[10]; char filename_out[10]; int cr = 13; puts("Enter File Name to remove cr's"); gets(filename); puts("Enter Filename to save as "); gets(filename_out); fp_out = fopen(filename_out,"w"); if ((fp = fopen(filename,"r")) == NULL) { puts("Can't open file "); } else { while(( c = fgetc(fp)) != EOF) /* fetching chr by chr */ { if (c == cr) { puts("found "); } else fputc(c,fp_out); } puts("closing file\n"); fclose(fp); fclose(fp_out); } } On 11-Jan-99 Craig Beasland wrote: > Hi there, > > not a BSD solution, but there is a program called Super NoteTab for Windows > which will allow you to save in the UNIX format. Dont let the name put you > off it really is pretty good, especially when you have samba and notetab > editing files directly off you web server. > > www.notetab.com > > cheers > craig > > -----Original Message----- > From: owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of > charon@freethought.org > Sent: Monday, 11 January 1999 15:08 > To: questions@FreeBSD.ORG > Subject: replacing ^M in vi > > > Whenever I save a plain text file in WinNT and open it in FreeBSD, at the > end of every line is a "^M". How do I get rid of these? I tried writing a > little C++ program to copy all text except "^M" to another file, but it > doesn't work because C++ treats the ^ and the M as different characters, > whereas vi treats them as _one_ character. After searching the mailing > list archives, I came up with the syntax ":%s/stuff/other stuff/g" as the > oh-so-intuitive replace command in vi, and I tried it, but to no avail (it > says "no match found"). Any suggestions? Thanks, > > > > Charon@freethought.org > http://members.home.net/tuathadedanann/ > > alt.sex.fetish.hamster.duct-tape > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message --- ---------------------------------- E-Mail: Keith Anderson Date: 12-Jan-99 Time: 23:13:54 Satelite Service 64K to 2Meg This message was sent by XFMail ---------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message