Re: database debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 22 Oct 2014, Jude DaShiell wrote:

The last field in each record ought to be a number from 0-6 inclusive
followed by a );.  I may have one of those numbers wrong somewhere.  I was
trying to use grep to show me whatever character immediately preceeds the
); characters and couldn't figure out anything to pass to grep for any
character that would return any results.  In dos, that would just be a ?,
but that certainly doesn't work with grep.

First, grep will show yu the entire line. You'd need to use something like cut or one of those other text manipulation commands to just show yu the end of the line.

You could get it to show you any offending lines by piping your output to:

grep -v '[0-6]);'

But it would surely be easier to use a select statement to find the offending entries for you.

SELECT <whatever> WHERE NOT REGEXP '[0-6]$';

See http://dev.mysql.com/doc/refman/5.1/en/regexp.html (you can click through to the version appropriate for your version of MySQL).

HTH,
Geff.

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list




[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]