0

i'm new to MYSQL and i'm working on it through phpMyAdmin.

My issue is that i have imported a set of tables in after creating a database for them. I wrote some codes to obtain some values which are dates in a column and binary numbers in the second column, so i have 2 columns in total. Those date values are in the following format: dd-mm-yyyy

I want to export it to an Excel file and phpMyAdmin provides 2 exporting option which are:

  1. CSV
  2. CSV for MS Excel

For the first option, it exports "some" of the date values like this: ####### while there are other dates exported correctly but in this shape: dd/mm/yyyy !!

For the second option, it exports them all correctly with this date shape: dd/mm/yyyy, but all they are in one column like this:

2016-01-25;"0"
2016-01-25;"1"

Note: the imported tables are: UTF8_general_ci I tried different formats, different things but i don't know, i couldn't have the values appearing correctly in 2 columns !!

Thanks in advance.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Kale
  • 81
  • 1
  • 8
  • 1
    Are those `#######` in the CSV file or in Excel? If the latter, then it's possible that it's just a display problem. Make the columns wider in Excel. Please show the first few lines of your exported file (both options). – PerlDuck Feb 28 '16 at 16:24
  • 1
    In case of the 2nd phpmyadmin exports the data with ; as field separator, but that's not the default field separator in your excel (or in your windows for that matter). Use text to columns function within excel to split the column by ; Your question apparently has nothing to do with sw development, you should just hone your basic excel skills. – Shadow Feb 28 '16 at 16:36
  • @PerlDog yeah, it worked by making the column wider. Thank you so much, but why it can't be wide according to the value by itself? I mean i'm working with a company and i have to export some data with Excel file. I can't give them such a report or file and tell them wide it by yourselves !! – Kale Feb 29 '16 at 15:24
  • @PerlDog I'm sorry but i still have another problem with same topic which doesn't need to create another question for it. I'm trying to export another report and apparently it has some Persian or Arabic characters. When i export it, it appears like this: This is the original value: أحمد الكمالي and this is the exported value: أحمد  الكمالي I don't know how to solve it, here is a screenshot if you wanted to check! Here is my code's output before exporting: http://s22.postimg.org/ed65klrgx/image.png After Exporting: http://s22.postimg.org/ed65klrgx/image.png Thanks again :) – Kale Feb 29 '16 at 16:01
  • @PerlDog By the way, the following 2 question and their answers didn't help me! (1) http://stackoverflow.com/questions/34059102/how-to-export-arabic-text-from-mysql-database-to-csv-using-toad-for-mysql (2) http://stackoverflow.com/questions/6859018/save-data-in-arabic-in-mysql-database/19588466#19588466 – Kale Feb 29 '16 at 16:03
  • I suggest you pose a new question with keywords like _MySQL, export, Persian/Arabic characters, import, Excel_. You just asked exaclty one person: me. I don't know, but it's likely other people _do_ know. – PerlDuck Feb 29 '16 at 16:25

2 Answers2

0

The hash marks ('#######') in Excel indicate that the value in that particular cell is too long to display as stated in @PerlDuck's comment. If you make the column wider you should be able to see your values. Note you can autofit any column to its values by double clicking the border between columns.

That said I think exporting to a standard CSV (comma separated value) should get you what you want. Modern editions of Excel handle raw CSV just as smoothly so I would go with that.

Trevor Reid
  • 3,310
  • 4
  • 27
  • 46
-2

I don't use Excel but it looks like Excel doesn't use ';' as the column separator when you import the file. You can likely change that behaviour after you've selected the files.

OscarJ
  • 413
  • 2
  • 11
  • Don't know why this one got downvoted. Sounds perfectly reasonable. I also don't use Excel but LibreOffice and when importing .csv files I get asked which separator to use. I _bet_ Excel does the same. – PerlDuck Feb 28 '16 at 17:17
  • I am sure that the possibility existed in Excel when I last used it more than a decade ago. And yeah, would be nice of whomever downvoted this to share their reasoning. – OscarJ Feb 29 '16 at 00:01