David Kearns Central RSS 2.0
# Tuesday, December 16, 2008
So I'm converting an Excel Spreadsheet to a SQL script and I forgot to escape the single quotes before surrounding all of the data with single quotes, which won't run in SQL of course. Usually I just start over, today I took it upon myself to determine how I can find these offending single quotes with a vim RegEx. Voila:

/[(,']\@<!'[,')]\@!

The only ones this misses is single quotes at the beginning or end of a field, like: ''Bobby Smith'', which should be escaped '''Bobby Smith''', but these are much easier to hunt down with all other cases taken care of with a simple :g//s//''/g knowwhatimean?

Tuesday, December 16, 2008 10:34:29 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2] -
work
Wednesday, December 17, 2008 6:31:20 PM (Eastern Standard Time, UTC-05:00)
Dude it's such a painfully obvious solution.

Question: When you're doing the black magic do you wear a cape, or is it strictly a jeans and t-shirt affair?
Dari
Wednesday, December 17, 2008 7:41:39 PM (Eastern Standard Time, UTC-05:00)
It only works in geek chic, that's why we dress the way we do...
Comments are closed.
Archive
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions.

© Copyright 2010
David Kearns
Sign In
Statistics
Total Posts: 1300
This Year: 1
This Month: 0
This Week: 0
Comments: 1761
Themes
Pick a theme:
All Content © 2010, David Kearns
DasBlog theme 'Business' created by Christoph De Baene (delarou)