I have written a script which is fetching data from database.
Now I want to enhance that script to create a xml file with data which is return by database.
How may i convert that string to xml file in shell script.
#!/bin/sh echo 'SELECT TABLE_NAME AS "Table Name", table_rows AS "Quant of Rows", ROUND((data_length + index_length)/1024/1024,2) AS "Total Size Mb" FROM information_schema.TABLES WHERE information_schema.TABLES.table_schema="database_name";' | mysql -u root -pmysql
data getting from database
"Table Name\tQuant of Rows\tTotal Size Mb\ntable_1\t2\t0.02\ntable_2\t1\t0.02\ntable_3\t142\t0.02\ntable_4\t50839\t5.03\ntable_5\t16573\t5.13\ndlr\t0\t0.02\ntable_6\t6\t0.02\ntable_7\t0\t0.03\ntable_8\t2\t0.08\ntable_9\t4\t0.02\n"
I want to write some logic into script which convert this string to xml file.
How may i do that ? What are the preferred way to handle this scenario ?