Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 555783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:51:02+00:00 2026-05-13T11:51:02+00:00

I sometimes import data from CSV files that were provided to me, into a

  • 0

I sometimes import data from CSV files that were provided to me, into a mysql table.

In the last one I did, some of the entries has a weird bad character in front of the actual data, and it got imported in my database. Now I’m looking for a way to clean it up.

The bad data is in the mysql column ’email’, it seems to be always right in front of the actual data. When trying to print it on my screen using PHP, it shows up as �. When exporting it to a CSV file, it looks like  , and if I SET CHARACTER SET utf8 before printing it on the screen using PHP, it looks like a normal space ‘ ‘.

I was thinking of writing a PHP script that goes over all my rows one at a time, fix the email address field, and update the row. However I’m not quite sure about the “fix the email” part!

I was thinking maybe to do a “explode” and use the bad character as a delimiter, but I don’t know how to type that character into my code.

Is there maybe a way to find the underlying value/utf8/hex or whatever of that character, then find it in the string?

I hope it’s clear enough.

Thanks

EDIT:
In Hex, it looks like it’s A0. What can I do to search and delete a character by its hex value? Either in PHP or directly in MySQL I guess …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:51:03+00:00Added an answer on May 13, 2026 at 11:51 am

    I think I found a PHP answer that seems to work more reliably:

    $newemail = preg_replace('/\xA0/', '', $row['oldemail']);
    

    And then I’m going to update the row with the new email

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm aiming to import data from various folder and text files into matlab. clear
I'm working on importing data into MySQL from two business systems. I've written some
I have a piece of code that imports data into a sql table. When
When I importing data to a new table from a large excel, if one
Sometimes you come by Zip files with file or directory with some unrecognized characters
Sometimes, tomcat restart will cause my application stop immediately so that my consuming data
we periodically need to import a CSV that looks like this: Name,SpecID,TestResult1,TestResult2,TestResult3 Alex,ASD123,3.23,452.2,232 Craig,DFG444,453.56,345.3,23
I am reading data from a csv file, and there are date elements in
i am trying to read in some data from an excel: If (FileUpload1.PostedFile.ContentType =
My main web application is on apache, but sometimes I need to import some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.