Question:
Can a CSV file hold html information?
unrealt87
2010-05-28 04:05:20 UTC
Hello Internet!

A question for the more technically minded this one.
I am currently trying out the method of listing items on eBay via the use of CSV files.
My question is this: is it at all possible for a CSV to hold HTML information without going very wrong?
I have tried uploading it a couple of times now, but each upload file, the cell which held the HTML code had been emptied.
If anyone can think of a solution to this problem I would be very greatful.
Thanks in advance,
Unrealt87
Four answers:
Tizio 008
2010-05-28 04:19:26 UTC
it is possible, carefully.

csv is a very simple format and the field separator can appear as well in the html fragment, so we need to escape it each time it appears in the html, and unescape back before using the fragment. the same for the record separator: it is a common char that cn appear itself in the html,causig problems;

in this case, the escaping is harder (or makes the csv parser a little bit harder).



a better way would be to use separators which can't appear in the field (eg. byte 0xFF instead of newline for record separator, and byte 0x00 for field separator....)

or we can encode ALL the html fragment, for example in plain hex digits, e.g. instead of storing the html as



....

we store

3C68746D6C3E0A

and so on...

we this way double the field size of course... but we stay safe and still the parser for our csv file is easy to be written.
amaya
2016-12-04 09:51:42 UTC
while you're utilising MS front web site you may place your Excel Spreadsheet interior a HTML web site. Use insert-> element-> officespead sheet. Then use the spreadsheet property gadget field (on the right of the spreadsheet) to import the information or vehicle replace the information. in case you have not got front web site, Make a table, reproduction and previous your column to the information superhighway pages columns, yet bear in mind that each and each browser will interpret a table somewhat in any different case (tables at the instant are not right) so all your information could desire to not line up properly.
peteams
2010-05-29 17:51:29 UTC
Yes and No.



In the general case, CSV is just a container format, so suitably encoded data of any flavour can be stored in it.



However in the general case of providing input to an existing system, e.g. eBay, you may find that it does not accept HTML encoded in any format.
2014-08-26 09:32:43 UTC
Try this:-

Its works fine-



https://github.com/evan06alam/html2csv-2



for further help email me at evan06alam@gmail.com


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...