Solved

Problems replacing aphostophies

Posted on 2012-04-13
3
474 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now