DMelt:IO/4 CSV File Format

From jWork.ORG
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member
Contents

CSV file format

Cross platform I/O can be also achieved using Comma-separated values (CVS) files. You can use this format to fill spreadsheets and read them in spreadsheet programs (OpenOffice.org Calc, Excel, Gnumeric, StarCalc). The format is a text file, encoded in ASCII, with a header and body. The Java class for this format is called jhplot.io.HFileCSV.

Here is a simple Python example showing how to create a CSV file

from jhplot import *
from jhplot.io import *

p=P1D("X-Y values with error 0.5 on Y")
p.add(1,2,0.5)   
p.add(2,10,0.5)
p.add(3,61,0.5)

f=HFileCSV("test.csv","w")
f.write(p)
f.close()

The output file "test.csv" can be read in OpenOffice or any other spreadsheet programs.

Here is a more complicated example:

ASCII, Gauss, Matlab, Excel data formats

DataMelt can read data (timeseries) in variety of formats, such as ASCII, Gauss, Matlab, Excel. Data can be modified, showed as tables/ One can plot such data and perform a statistical analysis. One can also save such data into files. Read Time series for detail since this topic is closely related to financial calculations

More information on this topic is in DMelt books