Solved

Problems replacing aphostophies

Posted on 2012-04-13
3
479 Views
Last Modified: 2012-04-13
I was hoping that someone might help me understand why a problem I had importing data occurred and how I can resolve it if it happens in the future.

I was importing data using mySQL workbench and used MS Excel / MS Word to add apostrophes around the text before I imported it.  I then encountered an error when mySQL did not like one of the apostrophes.

(1,'Administrator',6,15,25,‘2012-04-13 00:00:00','1899-12-30 12:18:00','T Administrator')

Only the apostrophe before 2012-04 caused a problem but no matter what I replaced it with in Word, mySQL refused to accept it.  In the end, since I only had 50 records, I changed them all by hand to get the data import to work.

I would appreciate if someone could tell me what causes this behaviour and how to get around it.  Why would only one apostrophe be different – I originally added them all in MS Excel before saving the file in a .csv format, opening it in MS Word.

The steps I took were:
1)      added single quotes around some columns that contained data i.e. =”’” & C4 & “’”
2)      Copied column and pasted Values only
3)      Copied all columns into table in MS Word
4)      Converted table to text using commas as field break
5)      Replaced all paragraphs with ),( adding an initial opening bracket
6)      Copied into MySQL and made it into an Insert query
0
Comment
Question by:Nemetona
  • 2
3 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 37843048
It looks like a "Smart quote" to me. This one is for opening speech. The closing version looks the same, but turned through 180 degrees.  Some software will treat it like an apostrophe, and some won't.
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 37843081
"Smart quotes" is Word's term to differentiate them from straight quotes. The default setting in Word's Autocorrect  is to substitute these angled versions whenever the user hits the single quote (apostrophe) or the double quotes keys.
"'
0
 

Author Closing Comment

by:Nemetona
ID: 37843214
I'm still not very sure why it only happened with the quote before the 2012 and none of the other ones.

By turning off the Autocorrect option to replace straight quotes with curly quotes the issue has gone away.

Many thanks.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Response times in Excel 18 44
Set WorkSheet  not Working 9 43
SQL Recursion schedule 13 18
SQL - Curser to do an insert based on a select 2 12
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question