Skip to content

Instantly share code, notes, and snippets.

@mosheeshel
Created February 6, 2018 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mosheeshel/4768e3b857322e7dc3433b44be40df00 to your computer and use it in GitHub Desktop.
Save mosheeshel/4768e3b857322e7dc3433b44be40df00 to your computer and use it in GitHub Desktop.
import com.kenshoo.xlsx2csv.XlsxToCsvConverter;
import java.io.*;
public class Converter {
private final static String SOURCE_FILE_PATH = "/path/example-input.xslx"
private final static String DEST_FILE_NAME = "/path/example-result.csv"
//building a new converter with default parameters
private final XlsxToCsvConverter xlsxToCsvConverter = new XlsxToCsvConverter.Builder().build();
public void function convert() {
final FileOutputStream outputStream = new FileOutputStream(new File(DEST_FILE_NAME));
final InputStream inputStream = new FileInputStream((SOURCE_FILE_PATH);
xlsxToCsvConverter.convert(inputStream, outputStream);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment