laradb

script pour établir une bdd Ãà partir d'un tsv avec différent format - retour accueil

git clone git://bebou.netlib.re/laradb
Log | Files | Refs |

main.sh (2355B)


      1 #!/bin/bash
      2 
      3 entree(){
      4 	#echo "$line" | cut -d"," -f $1
      5 	echo "$line" | tsv-select -f $1
      6 }
      7 
      8 DIST="../dist"
      9 DB="db.tsv"
     10 
     11 LIGNE=1
     12 cat << % > $DIST/tableau.html
     13 <!DOCTYPE html>
     14 <html>
     15 	<head>
     16 		<title>The Amateur Feminist Library</title>
     17         <link rel="stylesheet" href="style.css">
     18         <link rel="stylesheet" href="cssVarFilledCookies.css">
     19 		<script src="cssVarFilledCookies.js" defer></script>
     20 
     21 		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
     22 		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     23 		<meta name="HandheldFriendly" content="true">
     24 		<meta charset="utf-8">
     25 
     26 		<script src="script.js" defer></script>
     27 	</head>
     28 	<body>
     29 <section>
     30 <a href="">tableau</a>
     31 <a href="">carte</a>
     32 <a href="">frise</a>
     33 <a href="">à propos</a>
     34 </section>
     35     <table>
     36 $(while IFS= read -r line; do
     37     if [ $LIGNE -eq 1 ]; then
     38         cat <<- ENTETE
     39         <thead>
     40 	        <tr>
     41 	        <td onclick="sortTable(1)" class="titre">$(entree 1)</td>
     42 	        <td onclick="sortTable(2)" class="titre-complet">$(entree 2)</td>
     43 	        <td onclick="sortTable(3)" class="periodicite">$(entree 3)</td>
     44 	        <td onclick="sortTable(4)" class="debut">$(entree 4)</td>
     45 	        <td onclick="sortTable(5)" class="fin">$(entree 5)</td>
     46 	        <td onclick="sortTable(6)" class="numeros">$(entree 6)</td>
     47 	        <td onclick="sortTable(7)" class="format">$(entree 7)</td>
     48 	        <td onclick="sortTable(8)" class="ville" $(entree 8) >$(entree 8)</td>
     49 	        <td onclick="sortTable(9)" class="pays">$(entree 9)</td>
     50 	        <td onclick="sortTable(10)" class="sources">$(entree 10)</td>
     51 	        <td onclick="sortTable(11)" class="travaux-lies">$(entree 11)</td>
     52 	        </tr>
     53         </thead>
     54 
     55 ENTETE
     56 
     57     else
     58 	    cat <<- CORPS
     59 	    <tr>
     60 	    <td class="titre">$(entree 1)</td>
     61 	    <td class="titre-complet">$(entree 2)</td>
     62 	    <td class="periodicite">$(entree 3)</td>
     63 	    <td class="debut">$(entree 4)</td>
     64 	    <td class="fin">$(entree 5)</td>
     65 	    <td class="numeros">$(entree 6)</td>
     66 	    <td class="format">$(entree 7)</td>
     67 	    <td class="ville">$(entree 8)</td>
     68 	    <td class="pays">$(entree 9)</td>
     69 	    <td class="sources">$(entree 10)</td>
     70 	    <td class="travaux-lies">$(entree 11)</td>
     71 	    </tr>
     72 
     73 CORPS
     74 
     75     fi
     76     LIGNE=$(($LIGNE + 1))
     77 done < $DB
     78 )
     79 </table>
     80 
     81 	</body>
     82 </html>
     83 %