Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting Stars to Bulleted Text

1 view
Skip to first unread message

ami...@musicases.com

unread,
Jul 26, 2015, 10:30:34 AM7/26/15
to
Hi

I have a csv file which one of its column includes multi-line text, one text phrase and few lines list, each one is starting with star (*).
This content has to be converted to reach HTML text.

For example:
-----------------
Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.

* Line number one
* Line number two
* Line number three
------------------ To be converted to:
<p>Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.</p>
<ul>
<li>Line number one</li>
<li>Line number two</li>
<li>Line number three</li>
</ul>
------------------

How do I do it?

Many thanks,
Amitai

Jukka K. Korpela

unread,
Jul 27, 2015, 1:39:26 AM7/27/15
to
7/26/2015, 5:30 PM, ami...@musicases.com wrote:

> I have a csv file which one of its column includes multi-line text, one text phrase and few lines list, each one is starting with star (*).
> This content has to be converted to reach HTML text.

You mean "rich text, specifically HTML", I presume.

> For example:
> -----------------
> Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.
>
> * Line number one
> * Line number two
> * Line number three
> ------------------ To be converted to:
> <p>Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.</p>
> <ul>
> <li>Line number one</li>
> <li>Line number two</li>
> <li>Line number three</li>
> </ul>

What exactly is the problem with this? Reading CSV format and performing
such a simple manipulation sounds like a very simple assignment. The
specific code naturally depends on the programming language to be used.
And if there are problems in implementing the transformation, they are
specific to the programming language, not to HTML; HTML markup is here
just part of the output to be generated, and you have described it.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Helmut Richter

unread,
Jul 27, 2015, 3:56:53 AM7/27/15
to
Not for extracting the relevant portions from the CSV format but for the
modifications of markup, e.g. converting leading asterisks to HTML
<li>-elements, you might want to use Markdown. I like it because it is
straightforward: it does its job *without* offering many additional
options which you don't need but which make it more difficult to use.
And it seems to produce simple and correct HTML, other than HTML-output
options in some commercial text-processing software.

--
Helmut Richter

0 new messages