first commit

This commit is contained in:
MaddoScientisto 2026-03-14 20:04:39 +01:00
commit 4d332ef662
27586 changed files with 3281783 additions and 0 deletions

View file

@ -0,0 +1,50 @@
package jxl.demo;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import jxl.Cell;
import jxl.CellFeatures;
import jxl.CellReferenceHelper;
import jxl.Sheet;
import jxl.Workbook;
public class Features {
public Features(Workbook w, OutputStream out, String encoding) throws IOException {
if (encoding == null || !encoding.equals("UnicodeBig"))
encoding = "UTF8";
try {
OutputStreamWriter osw = new OutputStreamWriter(out, encoding);
BufferedWriter bw = new BufferedWriter(osw);
for (int sheet = 0; sheet < w.getNumberOfSheets(); sheet++) {
Sheet s = w.getSheet(sheet);
bw.write(s.getName());
bw.newLine();
Cell[] row = null;
Cell c = null;
for (int i = 0; i < s.getRows(); i++) {
row = s.getRow(i);
for (int j = 0; j < row.length; j++) {
c = row[j];
if (c.getCellFeatures() != null) {
CellFeatures features = c.getCellFeatures();
StringBuffer sb = new StringBuffer();
CellReferenceHelper.getCellReference(c.getColumn(), c.getRow(), sb);
bw.write("Cell " + sb.toString() + " contents: " + c.getContents());
bw.flush();
bw.write(" comment: " + features.getComment());
bw.flush();
bw.newLine();
}
}
}
}
bw.flush();
bw.close();
} catch (UnsupportedEncodingException e) {
System.err.println(e.toString());
}
}
}