gnuplot:make autotitle忽略标题行

时间:2017-09-28 12:16:12

标签: csv gnuplot

我想使用gnuplot从csv文件中绘制几行,这些行具有不固定数量的标题行和列。该文件可能如下所示:

HEADERLINE1           = TEXTTEXTTEXT 
HEADERLINE2           = TEXTTEXTTEXT
HEADERLINE3           = 1248243 
HEADERLINE4           = 329340


COLUMN_X      COLUMN_1       COLUMN_2
       1       36.9194        30.0000
       2       19.0977        20.0000
       3       12.9250        10.0000
       4       10.7134         0.0000

通常没有标题行我会使用这样的东西:

stats 'datafile.csv' nooutput
set key autotitle columnheader
plot for [t=2:STATS_columns] \
  datafile \
  using 1:t \
  with linespoints

但是使用标题行时,autotitle命令会使用这些标题行。有没有办法让autotitle从实际的列/秒块中选择列头/忽略标题?

由于

1 个答案:

答案 0 :(得分:2)

如果标题行和数据之间始终至少有两个空行,则可以使用int(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; <div class="col-md-4"> <h5 class="control-label" style="font-family:Lucida Calligraphy;margin-left: -15px">Date:</h5> <input type="text" name="datepicker" class="form-control" placeholder='Select date' id="datepicker" style="margin-left: -15px"/> <script> $(function() { $('#datepicker').datepicker({ minDate: 0, dateFormat: 'yy-mm-dd' }); }); </script> </div> <div class="col-md-4"> <h5 for="inputDate" class="control-label" style="font-family:Lucida Calligraphy;margin-left: -15px">Time: </h5> <select type="text" name="time" id="time" class="form-control"> <option>Select time</option> <option>08:00 AM</option> <option>09:00 AM</option> <option>10:00 AM</option> <option>11:00 AM</option> <option>01:00 PM</option> <option>02:00 PM</option> <option>03:00 PM</option> <option>04:00 PM</option> <option>05:00 PM</option> </select> </div> 会给您一些警告,但结果符合要求:

<?php 
   include('db.php');
   if(isset($_POST['reserve'])){
        $wdate = $_POST['datepicker'];
        $wtime = $_POST['time'];

        $wdate_array = array();
        $wtime_array = array();

        $insertDate=$conn->query("INSERT INTO date_tbl (date, time, ordertype) VALUES ('$wdate','$wtime',0)");

       $q=$conn->query("SELECT * FROM date_tbl");

       $dateRow=mysqli_num_rows($q);

           while($row=mysqli_fetch_array($q)){
               $wdate_array[]=$row['date'];
               $wtime_array[]=$row['time'];
           }
            if(array_intersect($wdate_array, $wtime_array)){
                echo "<p style='text-align:center;color:red;'><span class='fa fa-warning'></span> Date & Time Invalid!</p>";
            }else{
                echo "<p style='text-align:center;color:green;'><b></b> Date & Time are available!</p>";
            }
     }
?>

产量

enter image description here