قراءة وكتابة تنسيق ملف CSV
Contents
[
Hide
]
سيناريوهات الاستخدام المحتملة
يدعم Microsoft Excel العديد من التنسيقات مثل XLS و XLSX و XLSM و XLSB و CSV وغيرها. يدعم Aspose.Cells أيضًا العديد من هذه التنسيقات. يوضح هذا المقال كيفية قراءة وكتابة ملف Excel بصيغة CSV باستخدام Aspose.Cells.
قراءة وكتابة تنسيق ملف CSV
يحمّل الكود النموذجي التالي ملف CSV المصدر ويقرأ خلية A1 ثم ينقل محتواها إلى خلية C4 ويحفظه كملف CSV الناتج.
الكود المثالي
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workbook, _ := NewWorkbook_String("23166994.cvs") | |
worksheet, _ := worksheets.Get_Int(0) | |
cells, _ := worksheet.GetCells() | |
cell, _ := cells.Get_String("A1") | |
value, _ := cell.GetStringValue() | |
println(value) | |
cell, _ = cells.Get_String("C4") | |
cell.PutValue_String(value) | |
workbook.Save_String("23166994.csv") |