excel kanggo csv

Ngonversi Excel menyang CSV ing Jawa

Ing donya sing didhukung data saiki, kemampuan kanggo ngowahi file Excel menyang format CSV (Nilai Dipisahake Koma) dadi penting. Nalika file Excel akeh digunakake kanggo nyimpen lan nganalisa data, file CSV nawakake format sing luwih prasaja lan serbaguna sing bisa gampang diproses dening macem-macem aplikasi lan basa pamrograman. Ngonversi Excel dadi CSV nyedhiyakake cara kanggo nyepetake integrasi data, ningkatake interoperabilitas, lan nggampangake ijol-ijolan data ing antarane sistem sing beda-beda. Ing artikel iki, kita bakal njelajah carane ngrampungake tugas iki nggunakake Java Cloud SDK, nguatake sampeyan kanthi gampang ngowahi file Excel dadi CSV lan mbukak kunci potensial lengkap data sampeyan.

Excel kanggo Konversi CSV Cloud SDK

Nalika arep ngowahi file Excel dadi CSV nggunakake Jawa, [Aspose.Cells Cloud SDK kanggo Jawa] dadi solusi sing kuat lan efisien. Aspose.Cells Cloud minangka API sing sugih fitur sing nyedhiyakake dhukungan ekstensif kanggo manipulasi file Excel, kalebu kemampuan kanggo ngowahi file Excel menyang format CSV kanthi lancar. Dadi, manawa sampeyan lagi nggarap proyek migrasi data, analisis data, utawa skenario liyane sing mbutuhake konversi Excel dadi CSV, Aspose.Cells Cloud SDK ndayani sampeyan kanthi alat lan keluwesan kanggo nggayuh tujuan sampeyan kanthi efisien lan akurat.

Saiki, tambahake rincian ing ngisor iki ing pom.xml kanggo nambah referensi Cloud SDK ing proyek sampeyan.

<repositories>
    <repository>
        <id>AsposeJavaAPI</id>
        <name>Aspose Java API</name>
        <url>https://repository.aspose.cloud/repo/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-cells-cloud</artifactId>
        <version>22.8</version>
    </dependency>
</dependencies>

Sawise referensi Cloud SDK ditambahake, mangga ndhaftar akun liwat Cloud dashboard lan goleki / gawe rincian ID Klien lan Rahasia Klien.

Ngonversi Excel menyang CSV ing Jawa

Mangga tindakake pandhuan ing ngisor iki kanggo ngowahi XLSX menyang format CSV.

  • Nggawe conto kelas CellsApi nalika nyedhiyakake kredensial klien minangka argumen input.
  • Nemtokake jeneng input Excel, format asil minangka CSV, lan jeneng file output.
  • Unggah buku kerja Excel input menyang panyimpenan awan nggunakake metode uploadFile(…).
  • Pungkasan, nelpon metode cellsWorkbookGetWorkbook(…) kanggo miwiti operasi konversi XLSX dadi CSV.
// kanggo conto liyane, bukak https://github.com/aspose-cells-cloud/aspose-cells-cloud-java

try
    {
    // Entuk ClientID lan ClientSecret saka https://dashboard.aspose.cloud/
    String clientId = "bbf94a2c-6d7e-4020-b4d2-b9809741374e";
    String clientSecret = "1c9379bb7d701c26cc87e741a29987bb";
  
    // nggawe conto CellsApi nggunakake kredensial klien
    CellsApi api = new CellsApi(clientId,clientSecret);
    		
    // jeneng input buku kerja Excel
    String fileName = "source.xlsx";
    
    // rincian sandi yen workbook ing ndhelik
    String password = null;
    
    // Nemtokake manawa nyetel baris buku kerja dadi pas otomatis.
    Boolean isAutoFit = true;
    // Nemtokake apa mung nyimpen data tabel. Mung nggunakake pdf kanggo Excel.
    Boolean onlySaveTable = true;
    // format file asil
    String format = "CSV";
    		
    // mbukak file saka sistem lokal
    File file = new File("c://Users/nayyer/"+fileName);	
    
    // upload input XLSB menyang panyimpenan maya
    api.uploadFile("input.xlsx", file, "Internal");

    // nindakake operasi konversi dokumen
    File response = api.cellsWorkbookGetWorkbook("input.xlsx",  password,format, 
    			            isAutoFit, onlySaveTable, null,"Internal",  "Resultant.csv","Internal", null);        
            
    // pesen sukses print
    System.out.println("Excel to CSV sucessfully converted !");
    }catch(Exception ex)
    {
        System.out.println(ex);
    }
pratinjau file excel menyang csv

gambar1: - Pratinjau file Excel nganti CSV

File sampel sing digunakake ing conto ing ndhuwur bisa diundhuh saka myDocument.xlsx lan Resultant.csv.

Ngonversi XLSX lokal dadi CSV

Ing bagean iki, kita bakal sinau langkah-langkah carane ngowahi XLSX dadi CSV tanpa ngunggah file input menyang panyimpenan maya. Dadi, tindakake pandhuan ing ngisor iki.

  • Gawe conto CellsApi nalika nyedhiyakake kredensial klien minangka argumen input.
  • Nemtokake jeneng input Excel, format asil minangka CSV, lan jeneng file output.
  • Katelu, nelpon metode cellsWorkbookPutConvertWorkbook(…) kanggo miwiti konversi XLSX dadi CSV.
// kanggo conto liyane, bukak https://github.com/aspose-cells-cloud/aspose-cells-cloud-java

try
    {
    // Entuk ClientID lan ClientSecret saka https://dashboard.aspose.cloud/
    String clientId = "bbf94a2c-6d7e-4020-b4d2-b9809741374e";
    String clientSecret = "1c9379bb7d701c26cc87e741a29987bb";

    // nggawe conto CellsApi nggunakake kredensial klien
    CellsApi api = new CellsApi(clientId,clientSecret);
    		
    // jeneng input XLSX workbook
    String fileName = "myDocument.xlsx";
    // rincian sandi yen workbook ing ndhelik
    String password = null;
    // format file asil
    String format = "CSV";
    		
    // mbukak file saka sistem lokal
    File file = new File("c://Users/nayyer/"+fileName);	
    
    // Ngonversi XLSX kanggo operasi CSV
    File response = api.cellsWorkbookPutConvertWorkbook(file, format, password, "Converted.csv", null, null);  
            
    // pesen sukses print
    System.out.println("Excel to CSV sucessfully converted !");
    }catch(Exception ex)
    {
        System.out.println(ex);
    }

XLSX menyang CSV nggunakake CURL Commands

Cara liya sing kuat kanggo ngowahi file Excel dadi CSV yaiku liwat perintah cURL lan Aspose.Cells Cloud REST API. Kanthi Aspose.Cells Cloud REST API, sampeyan bisa nindakake macem-macem operasi ing file Excel, kalebu konversi menyang CSV, nggunakake printah cURL prasaja lan langsung. Kanthi nggunakake kekuwatan perintah cURL lan Aspose.Cells Cloud REST API, sampeyan bisa ngotomatisasi proses konversi, nangani file Excel sing gedhe, lan entuk asil sing efisien lan dipercaya.

Saiki, jalanake perintah ing ngisor iki kanggo ngasilake token akses JWT:

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=bbf94a2c-6d7e-4020-b4d2-b9809741374e&client_secret=1c9379bb7d701c26cc87e741a29987bb" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Sawise JWT digawe, tindakake printah ing ngisor iki kanggo ngowahi XLSX dadi CSV lan simpen output ing panyimpenan maya. Elinga yen input XLSX wis kasedhiya ing panyimpenan maya.

curl -v -X GET "https://api.aspose.cloud/v3.0/cells/myDocument(1).xlsx?format=CSV&isAutoFit=false&onlySaveTable=false&outPath=converted.csv&checkExcelRestriction=true" \
-H  "accept: application/json" \
-H  "authorization: Bearer <JWT Token>"

Kesimpulan

Apa sampeyan milih nggunakake Aspose.Cells Cloud SDK kanggo Jawa utawa nggunakake perintah cURL nganggo Aspose.Cells Cloud REST API, sampeyan duwe alat sing kuat kanggo konversi Excel dadi CSV. Pendekatan kasebut nyedhiyakake keluwesan, skalabilitas, lan gampang integrasi, ngidini sampeyan ngowahi file Excel menyang format CSV kanthi gampang. Mula, kanthi nggunakake teknologi kasebut, sampeyan bisa ngotomatisasi proses konversi, nyepetake alur kerja, lan ngekstrak data sing penting saka file Excel kanthi format sing kompatibel lan gampang diakses.

Pranala sing gegandhengan

Artikel sing gegandhengan

Disaranake ngunjungi tautan ing ngisor iki kanggo sinau luwih lengkap babagan: