1

I am using this method to export HTML Tables to Excel. However some of the colums in my data have < characters. This cause an error when I try to open the file in Excel. Is there some way to ignore these characters or automatically replace them? Eg:

<tr>
<td>Assume A>B</td>
</tr>

PS: I already have the html data with < character. I am pulling it into a new page, which has a button to export it to excel (using xml format).

Community
  • 1
  • 1
Anurag Saran
  • 301
  • 2
  • 13

2 Answers2

1

I am not aware of any solution to the problem mentioned by you. However a workaround can be to write a small data sanitation script using Perl/sed to sanitize your data. The details of such a script might be taken from here.

user4763550
  • 121
  • 5
0

MS-Excel in general has no problem with the '<' character. HTML applications however tend to interprete the '<' character as start of an HTML tag.

You can replace the character by &lt; during the export and import, and replace this back to '<' when in Excel.

Or you can make sure that text fields are quoted during the process.

  • 1
    I already have the html data with < character. I am pulling it into a new page, which has a button to export it to excel (using xml format). Edited the Question to add the same info. – Anurag Saran Jul 02 '15 at 06:44