Re: two files in one file

"Daniel Goldman [email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
In this case, I also don't see the point of the second file. I would 
rename the subject "transform input data file". :)

Here is another possible way you might do the task:

$ cat file1.txt
google.com FR OK 2 September 2015 21
yahoo.com FR OK 3 September 2016 125
dell.com US OK October 3, 2017 365

$ cat script1.sh
#!/bin/bash

while read url lang ok_no date_1 date_2 year number; do
   echo "<tr>"
   echo "<td> $url </td>"
   echo "<td> $lang </td>"
   echo "<td> $ok_no </td>"
   echo "<td> $date_1 $date_2 $year </td>"
   echo "<td> $number </td>"
   echo "</tr>"
done

$ script1.sh < file1.txt
<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>

If the output needs to be sorted by some combination of input fields, 
then do something like:

sort [some parameters] file1.txt | script1.sh

BTW, what is a "mask file"? I've never heard that term used before. Any 
chance you have a reference you could share?

Daniel

On 4/16/2015 5:26 AM, MOKRANI Rachid [email protected] [sed-users] 
wrote:
> I don't understand  (in which way do you need the second file)
>
>
> The first file is generated by a script. The result is in text format.
>
> I need to create an html table with this result. The result need to be sort by the fifth column
>
> I thought creating an html mask file, and insert the result of my script in this file.
>
>
>
>
>
>> -----Message d'origine-----
>> De : [email protected] [mailto:[email protected]]
>> Envoyé : jeudi 16 avril 2015 14:21
>> À : [email protected]
>> Objet : Re: two files in one file
>>
>> in which way do you need the second file? If you just want to make the
>> file into a html table, it is easy.
>>
>>
>>
>> On 16/04/15 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.
>>>
>>>
>>>
>>>
>>>
>>> __________________________
>>> Avant d'imprimer, pensez à l'environnement ! Please consider the
>> environment before printing !
>>> Ce message et toutes ses pièces jointes sont confidentiels et établis à
>> l'intention exclusive de ses destinataires. Toute utilisation non conforme à sa
>> destination, toute diffusion ou toute publication, totale ou partielle, est
>> interdite, sauf autorisation expresse. IFP Energies nouvelles décline toute
>> responsabilité au titre de ce message. This message and any attachments are
>> confidential and intended solely for the addressees. Any unauthorised use or
>> dissemination is prohibited. IFP Energies nouvelles should not be liable for
>> this message.
>>> __________________________
>>>
>>>
>>> [Non-text portions of this message have been removed]
>>>
>>>
>>>
>>> ------------------------------------
>>> Posted by: MOKRANI Rachid <[email protected]>
>>> ------------------------------------
>>>
>>
>>
>>
>> ------------------------------------
>> Posted by: Thierry Blanc <[email protected]>
>> ------------------------------------
>>
>> --
>>
>> ------------------------------------
>>
>> Yahoo Groups Links
>>
>>
>>
> __________________________
> Avant d'imprimer, pensez à l'environnement ! Please consider the environment before printing !
> Ce message et toutes ses pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. IFP Energies nouvelles décline toute responsabilité au titre de ce message. This message and any attachments are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP Energies nouvelles should not be liable for this message.
> __________________________
>
>
> ------------------------------------
> Posted by: MOKRANI Rachid <[email protected]>
> ------------------------------------
>
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.