0

I'm trying to export a mysql table into csv format, by running this command in mysql command line

    mysql -u root -p mydb -e "select * from mytable" -B | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > mytable.csv 

however there are many html tags and characters so is there anyway i could add a command to parse the html???

jukerok
  • 337
  • 2
  • 4
  • 10
  • Isn't it better? https://stackoverflow.com/questions/356578/how-to-output-mysql-query-results-in-csv-format – Bor Laze Jun 18 '17 at 18:13
  • @BorLaze yeah that is actually cool i have checked it before asking this question, but the thing is the table contains html tags and i want them removed, so do you think there is a cool and easy way to get that done?? – jukerok Jun 18 '17 at 18:17
  • *"HTML ... characters"* ... meaning numeric character and character entity [references](https://en.m.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references), like ` `, ` `, and/or ` `? – Michael - sqlbot Jun 18 '17 at 18:53
  • Yeah plus tags like

    – jukerok Jun 18 '17 at 18:59

0 Answers0