احتفظ بالفواصل للصفوف الفارغة أثناء تصدير جداول البيانات بتنسيق CSV

احتفظ بالفواصل للصفوف الفارغة أثناء تصدير جداول البيانات بتنسيق CSV

يوفر Aspose.Cells القدرة على الاحتفاظ بفواصل الأسطر أثناء تحويل جداول البيانات إلى تنسيق CSV. لهذا ، يمكنك استخدام**[KeepSeparatorsForBlankRow] (https://reference.aspose.com/cells/net/aspose.cells/txtsaveoptions/properties/keepseparatorsforblankrow)**ممتلكات**[TxtSaveOptions] (https://reference.aspose.com/cells/net/aspose.cells/txtsaveoptions)**صف دراسي.**[KeepSeparatorsForBlankRow] (https://reference.aspose.com/cells/net/aspose.cells/txtsaveoptions/properties/keepseparatorsforblankrow)**هي خاصية منطقية. للاحتفاظ بفواصل الأسطر الفارغة أثناء تحويل ملف Excel إلى CSV ، قم بتعيين**[KeepSeparatorsForBlankRow] (https://reference.aspose.com/cells/net/aspose.cells/txtsaveoptions/properties/keepseparatorsforblankrow)**ملكية ل**حقيقي**.

يقوم نموذج التعليمات البرمجية التالي بتحميل ملفملف Excel المصدر. يحدد**[TxtSaveOptions.KeepSeparatorsForBlankRow] (https://reference.aspose.com/cells/net/aspose.cells/txtsaveoptions/properties/keepseparatorsforblankrow)**ملكية ل**حقيقي** ويحفظها باسمالإخراج. csv . تُظهر لقطة الشاشة المقارنة بين ملف Excel المصدر ، والإخراج الافتراضي الذي تم إنشاؤه أثناء تحويل جدول البيانات إلى CSV والإخراج الناتج عن الإعداد**[KeepSeparatorsForBlankRow] (https://reference.aspose.com/cells/net/aspose.cells/txtsaveoptions/properties/keepseparatorsforblankrow)** إلى**حقيقي**.

ما يجب القيام به: image_بديل_نص

عينة من الرموز

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
string filePath = dataDir + "Book1.xlsx";
// Create a Workbook object and opening the file from its path
Workbook wb = new Workbook(filePath);
// Instantiate Text File's Save Options
TxtSaveOptions options = new TxtSaveOptions();
// Set KeepSeparatorsForBlankRow to true show separators in blank rows
options.KeepSeparatorsForBlankRow = true;
// Save the file with the options
wb.Save(dataDir + "output.csv", options);