public static String statvar(String file) {
        StringBuffer head = new StringBuffer("@H, date");
        StringBuffer type = new StringBuffer(" " +  DataIO.KEY_TYPE + ", Date");
        StringBuffer dout = new StringBuffer(",");

        File statvar = new File(file);
        if (!statvar.isAbsolute()) {
            String work = System.getProperty("oms3.work");
            if (work == null) {
                return "Error no $work property found, use full qualifies name instead.)";
            }
            statvar = new File(work + "/data", file);
        }
        String name = statvar.getName().substring(0, statvar.getName().indexOf('.'));
        File out = new File(statvar.getParentFile(), name + ".csv");

        try {
            FileReader fr = new FileReader(statvar);
            BufferedReader br = new BufferedReader(fr);

            String statHdr = br.readLine();
            int varNum = Integer.parseInt(statHdr);
            for (int i = 0; i < varNum; i++) {
                String s = br.readLine();
                String[] st = s.split("\\s+");
                head.append(", " + st[0]);
                type.append(", double");
            }

            PrintWriter w = new PrintWriter(out);
            w.println("@T, \"Table\"");
            w.println(" " + DataIO.KEY_CREATED_AT + ", \"" + new Date() + "\"");
            w.println(" " + DataIO.KEY_CONVERTED_FROM + ", \"" + statvar + "\"");
            w.println(" " + DataIO.DATE_FORMAT + ", yyyy MM dd H m s");
            w.println(head);
            w.println(type);

            String data;
            while ((data = br.readLine()) != null) {
                String[] str = data.split(" ");
                for (int i = 1; i < 7; i++) {
                    dout.append(str[i] + " ");
                }
                dout.append(",");
                for (int i = 7; i < str.length - 1; i++) {
                    dout.append(str[i] + ",");
                }
                dout.append(str[str.length - 1]);
                w.println(dout);
                dout.delete(1, dout.length());
            }
            fr.close();
            w.close();
            return "  Converted: '" + file + "' -> '" + out + "'\n";
        } catch (IOException ioe) {
            return "Error : " + ioe.getMessage() + "\n";
        }
    }