Try this,

The code below will remove the last character from
each record in your file. On your Linux system
enter this line on the command line and the
results will appear in the NEW_FILE. Obviously you
can name the input and output files anything you
want.

awk '{print substr($0, 1, length-1)}' YOUR_FILE >
NEW_FILE

Note that 'one-liner' script will remove the last
char from each record whether it is a ^M or not,
so don't use it on all your files.

Michael Thomas
www.abcXyz.com

-----Original Message-----
From: John W Ford [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 12, 2001 11:04 PM
To: Mysql
Subject: special characters messing me up


I can't figure out why my windows machine leaves
"^M" character at the end
of each line of code. This causes the file to be
messed up when I put it on
the Linux server.

It makes my perl interpreter look for a file named
^M after the very first
line.

#!/usr/sbin/perl

also... what else I can't figure out is why this
special character is
sometimes hidden and sometimes visible in my Emacs
program in Linux... this
is the program I used in which I found the
problem.

anybody know?

John Ford


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to