import com.aspose.cells.*;
public class Main {
    public static void main(String[] args) throws Exception // Convert TXT to JSON in Java
    {
        // Set the licenses
        new License().setLicense("License.lic");

        // Load TXT file
        Workbook workbook = new Workbook("sample.txt");

        // Create JsonSaveOptions class object
        JsonSaveOptions options = new JsonSaveOptions();

        // Save output JSON file
        workbook.save("output.json", options);

        System.out.println("Done");
    }
}