* database debugging
@ Jude DaShiell
` Geoff Shang
0 siblings, 1 reply; 3+ messages in thread
From: Jude DaShiell @ UTC (permalink / raw)
To: blinux-list
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.
jude <jdashiel@shellworld.net> Twitter: @jdashiel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: database debugging
database debugging Jude DaShiell
@ ` Geoff Shang
0 siblings, 0 replies; 3+ messages in thread
From: Geoff Shang @ UTC (permalink / raw)
To: Linux for blind general discussion
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* database debugging
@ Jude DaShiell
0 siblings, 0 replies; 3+ messages in thread
From: Jude DaShiell @ UTC (permalink / raw)
To: blinux-list
I found out what I can't do with grep, I can do with cut. I used cut -b
54-56 to get the last three characters of each record output to the
terminal.
jude <jdashiel@shellworld.net> Twitter: @jdashiel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~ UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
database debugging Jude DaShiell
` Geoff Shang
Jude DaShiell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).