Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RegEx for ^M 1

Status
Not open for further replies.

max1x

Programmer
Joined
Jan 12, 2005
Messages
366
Location
US
The output from a DB is spitting out ^M as the end of some recordsets, which is causing some issues with data handling from a flat file. I need to detect all the data entry points with this issue vs just fix it.

Code:
print $_ if ($_ !~ /[a-z0-9]$/i); but this is not working for me.

P.S: I don't have access to the DB.
 
Code:
if (/\r/) {
  print "we have a carriage return in there";
}

HTH
--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
$line=~ s/\r//g; #Fix it

dmazzini
GSM System and Telecomm Consultant

 
Thanks Paul & dmazzini, sometimes u just need a fresh pair of eyes to look at the issue :), slipped my mind...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top