Re: two files in one file

"'Ruud H.G. van Tol' [email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
On 2015-04-16 11:14, MOKRANI Rachid [email protected] [sed-users] 
wrote:
> Hi,
>
> Using data from a text file I want to create an HTML table.
>
> I have a first file  with data like : (this file is generate automatically, and the line order can change )
> google.com         FR          OK          2 September 2015         21
> yahoo.com         FR           OK          3 September 2016          125
> dell.com              US          OK          October 3, 2017               365
> oracle.com         EN          NO         3 December 2015            542
> ibm.com              ES           OK          November 18, 2015        21
> sap.com              ES           NO         January 26, 2018              36
> mysql.com         US          OK          7 Jul 2016                            25
> etc ....
>
>
> My second file (second.html) is a mask in html format.
>
> ....
> ....
>           <TR>
>    <TD> Value B1 </ TD>
>    <TD> Value B2 </ TD>
>    <TD> Value B3 </ TD>
>    <TD> Value  B4 </ TD>
>    <TD> Value B5 </ TD>
>           </ TR>
> <TR>
>    <TD> Value C1 </ TD>
>    <TD> Value C2</ TD>
>    <TD> Value C3</ TD>
>    <TD> Value C4 </ TD>
>    <TD> Value C5 </ TD>
> </ TR>
>
> <TR>
>    <TD> Value D1 </ TD>
>    <TD> Value D2 </ TD>
>    <TD> Value D3 </ TD>
>    <TD> Value D4 </ TD>
>    <TD> Value D5 </ TD>
> </ TR>
> ...
> ....
> I need to obtain a third file like this. Data from my first file need to insert in my second file for the following result.
>
> ....
> ....
>           <TR>
>    <TD> google.com </ TD>
>    <TD> FR </ TD>
>    <TD> OK </ TD>
>    <TD> 2 September 2015</ TD>
>    <TD> 21 </ TD>
>           </ TR>
> <TR>
>    <TD> yahoo.com </ TD>
>    <TD> FR </ TD>
>    <TD> OK </ TD>
>    <TD> 3 September 2016</ TD>
>    <TD> 125 </ TD>
> </ TR>
>
> <TR>
>    <TD> dell.com </ TD>
>    <TD> US </ TD>
>    <TD> OK </ TD>
>    <TD> October 3, 2017</ TD>
>    <TD> 365 </ TD>
> </ TR>
> ...
> ....etc...
>
>
>
>
> Any help ?
>
> Best regards.

Think data + template.

For example: http://www.template-toolkit.org/

-- 
Ruud
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.