我有一个数据文件,设置如下:
varName1= 1 varName2= 3
varName1= 3 varName2= 4
# and so on
是否有忽略变量名称的gnuplot
命令?
我只需要绘制数字。
我不能这样做:
plot "fileName.dat" linenumber
因为包含变量名称。
答案 0 :(得分:0)
在这些情况下,我建议使用Dim ExcelApp As excel.Application = Nothing
Dim ExcelWorkBook As excel.Workbook = Nothing
Dim ExcelWorkSheet As excel.Worksheet = Nothing
Dim Workbooks As excel.Workbooks = Nothing
Try
ExcelApp = New excel.Application
Workbooks = ExcelApp.Workbooks
ExcelWorkBook = Workbooks.Open("F:\ImpensaData.xlsx")
ExcelWorkSheet = ExcelWorkBook.Sheets(1)
''''GETTING EXCEPTION ON THIS LINE
ExcelWorkSheet.Cells(1, 1).interior.color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red)
ExcelWorkBook.Save()
Catch ex As Exception
MsgBox(ex.Message)
Finally
ExcelWorkBook.Close()
Workbooks.Close()
ExcelApp.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelWorkSheet)
System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelWorkBook)
System.Runtime.InteropServices.Marshal.ReleaseComObject(Workbooks)
System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelApp)
GC.Collect()
GC.WaitForPendingFinalizers()
End Try
或awk
等外部解析器。
在你的情况下,这应该有效:
sed
答案 1 :(得分:0)
gnuplot会将文件中的变量名称视为另一列。只需plot fname using 2:4
即可在您的示例中使用。
如果您在“=”之后并不总是有空格,则可以set datafile separator '= '
。 (这将“”和“=”设置为独立分隔符,而不是“=”。)