S
S
Sergey Dydaevskiy2017-11-02 22:32:34
HTML
Sergey Dydaevskiy, 2017-11-02 22:32:34

CSV - How to import strings from CSV to HTML with formatting and split strings into HTML files?

Hi guys again. In general, there is a CSV file, it has a certain number of lines (in fact, there are a lot of them to hell).
How to import each line into a separate *.HTML file with specific formatting?
For example in CSV there is content with title "title" and "Content". I need to implement the following:
1) Create a file {title}.HTML
2) Drive the following content into it:

<div class="title">{title}</div>
<div class="content">{content}</div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-11-02
@dydikson

Take CSV as one line - split into lines, run them in a loop breaking into substrings - extracting "title" and "Content". Add HTML code from the desired template to each line, replacing {title} and {content} with the values ​​of the substrings obtained during splitting.
Save output to file.
Language - any known. I would take Python because I know it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question