Przejdź do treści stopki
KORZYSTANIE Z IRONXL

C# CSV do XLSX: Konwertuj pliki CSV do formatu Excel

Konwersja plików CSV do formatu XLSX odblokowuje możliwości arkusza kalkulacyjnego, których pliki z wartościami rozdzielonymi przecinkami po prostu nie są w stanie zapewnić. Podczas gdy CSV przechowuje surowe dane tabelaryczne, format Excel XLSX obsługuje formuły, wiele arkuszy, wykresy, formatowanie komórek i walidację danych — funkcje wymagańe przez nowoczesne aplikacje biznesowe. Proces konwersji jest prosty przy użyciu odpowiedniej biblioteki i wymaga zaledwie kilku wierszy kodu C#.

Biblioteka IronXL .NET obsługuje tę konwersję bezpośrednio, bez konieczności korzystania z pakietu Microsoft Office lub zestawu Open XML SDK. Odczytuje źródłowy plik CSV, analizuje dane rozdzielone separatorami i zapisuje w pełni zgodny skoroszyt XLSX. Zainstaluj za pomocą NuGet i rozpocznij bezpłatny okres próbny, aby śledzić poniższe przykłady kodu.

Jak przekonwertować pliki CSV do formatu XLSX w języku C#?

Podstawowa konwersja wymaga załadowania pliku CSV i zapisania go w formacie Excel. IronXL udostępnia WorkBook.LoadCSV, który analizuje źródło rozdzielone separatorami i tworzy skoroszyt gotowy do eksportu. Metoda przyjmuje ścieżkę do pliku, docelowy format Excel oraz znak separatora.

using IronXL;

// Load CSV file and convert to XLSX format
WorkBook workbook = WorkBook.LoadCSV("data.csv", fileFormat: ExcelFileFormat.XLSX, ListDelimiter: ",");

// Access the default worksheet containing CSV data
WorkSheet worksheet = workbook.DefaultWorkSheet;

// Save as Excel XLSX file
workbook.SaveAs("output.xlsx");
using IronXL;

// Load CSV file and convert to XLSX format
WorkBook workbook = WorkBook.LoadCSV("data.csv", fileFormat: ExcelFileFormat.XLSX, ListDelimiter: ",");

// Access the default worksheet containing CSV data
WorkSheet worksheet = workbook.DefaultWorkSheet;

// Save as Excel XLSX file
workbook.SaveAs("output.xlsx");
Imports IronXL

' Load CSV file and convert to XLSX format
Dim workbook As WorkBook = WorkBook.LoadCSV("data.csv", fileFormat:=ExcelFileFormat.XLSX, ListDelimiter:=",")

' Access the default worksheet containing CSV data
Dim worksheet As WorkSheet = workbook.DefaultWorkSheet

' Save as Excel XLSX file
workbook.SaveAs("output.xlsx")
$vbLabelText   $csharpLabel

Wynik

C# CSV do XLSX: Kompletny przewodnik dla programistów: Obraz 1 – Przykładowy wynik konwersji pliku CSV do formatu Excel

Metoda LoadCSV przyjmuje trzy kluczowe parametry: nazwę pliku, stałą formatu docelowego Excel oraz separator listy używany w pliku źródłowym. Takie podejście pozwala zachować wszystkie dane tekstowe i wartości liczbowe z oryginalnego arkusza CSV, tworząc jednocześnie poprawnie ustrukturyzowany plik XLSX. Klasa WorkBook służy jako centralny punkt dla wszystkich operacji związanych z arkuszami kalkulacyjnymi. Po załadowaniu dane CSV stają się dostępne w arkuszach, co umożliwia dalszą edycję przed zapisaniem ostatecznego pliku Excel.

Aby wczytać istniejące pliki XLSX zamiast CSV, użyj WorkBook.Load("file.xlsx"), co automatycznie wykrywa format na podstawie rozszerzenia pliku. Ułatwia to tworzenie potoków, które akceptują dane wejściowe w formacie CSV lub Excel i normalizują je do jednego formatu wyjściowego.

Jakie są zalety konwersji plików CSV do formatu Excel?

Format XLSX oferuje wymierne zalety w porównaniu ze zwykłym CSV w większości scenariuszy zarządzania danymi:

  • Wiele arkuszy: Pliki Excel obsługują wiele arkuszy w jednym skoroszycie, umożliwiając uporządkowane przechowywanie danych, z którym pliki CSV nie mogą się równać. Pojedynczy plik XLSX może zawierać dziesiątki arkuszy obejmujących różne okresy, regiony lub kategorie.
  • Obsługa formuł: Pisz złożone obliczenia, agregacje i logikę warunkówą bezpośrednio w komórkach. Formuły programu Excel są przeliczane automatycznie po zmianie danych źródłowych, co eliminuje konieczność ręcznego przetwarzania plików CSV.
  • Visual Charts: Twórz wykresy słupkowe, liniowe, kołowe i inne wizualizacje na podstawie danych z arkusza kalkulacyjnego. IronXL obsługuje tworzenie wykresów bezpośrednio poprzez API, dzięki czemu wykresy są osadzone w pliku XLSX.
  • Formatowanie komórek: Kontroluj czcionki, kolory, obramowania i formaty liczb w profesjonalnych dokumentach. Pliki CSV przechowują wyłącznie wartości surowe; Format XLSX zachowuje warstwę wyświetlania wraz z danymi.
  • Walidacja danych: Ogranicz wprowadzanie danych w komórkach do określonych wartości lub zakresów, zapobiegając błędom wprowadzania danych w plikach udostępnianych użytkownikom końcowym.
  • Ochrona hasłem: Zabezpiecz arkusze i skoroszyty hasłami, aby kontrolować dostęp do odczytu i zapisu — funkcja całkowicie nieobecna w formacie CSV.

Te możliwości sprawiają, że format XLSX jest standardowym wyborem dla raportów, pulpitów nawigacyjnych, modeli finansowych i wszelkich aplikacji wymagających czegoś więcej niż tylko przechowywania surowych danych.

Jak zainstalować IronXL w projekcie .NET?

IronXL jest dystrybuowany jako pakiet NuGet. Zainstaluj go z konsoli menedżera pakietów w Visual Studio:

Install-Package IronXl
Install-Package IronXl
SHELL

Lub przy użyciu interfejsu CLI platformy .NET:

dotnet add package IronXl
dotnet add package IronXl
SHELL

Po instalacji dodaj using IronXL; do dowolnego pliku obsługującego arkusze kalkulacyjne. Pakiet jest przeznaczony dla platform .NET Framework 4.6.2+, .NET Core 3.1+, .NET 5 do .NET 10 i obsługuje środowiska wdrożeniowe Windows, Linux, macOS, Docker oraz Azure.

Nie są wymagańe żadne dodatkowe zależności środowiskowe ani instalacja pakietu Microsoft Office. IronXL odczytuje i zapisuje pliki XLSX przy użyciu własnego parsera i modułu zapisu, dzięki czemu nadaje się do wdrożeń po stronie serwera i bezinterfejsowych, gdzie nie można zainstalować pakietu Office.

Jak radzisz sobie z kodowaniem CSV podczas konwersji?

Wiele plików CSV pochodzi ze starszych systemów, międzynarodowych baz danych lub eksportów stron trzecich, które wykorzystują znaki spoza zestawu ASCII. Prawidłowe obsłużenie kodowania gwarantuje, że znaki specjalne i tekst międzynarodowy pozostaną nienaruszone w wynikowym pliku XLSX.

using IronXL;
using System.Text;

// Load CSV with explicit encoding specification
WorkBook workbook = WorkBook.LoadCSV("international-data.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",",
    encoding: Encoding.UTF8);

// Access the worksheet containing the encoded data
WorkSheet sheet = workbook.DefaultWorkSheet;

// Inspect a cell to verify encoding was preserved
string cellValue = sheet["A1"].StringValue;

// Save the converted Excel file
workbook.SaveAs("encoded-output.xlsx");
using IronXL;
using System.Text;

// Load CSV with explicit encoding specification
WorkBook workbook = WorkBook.LoadCSV("international-data.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",",
    encoding: Encoding.UTF8);

// Access the worksheet containing the encoded data
WorkSheet sheet = workbook.DefaultWorkSheet;

// Inspect a cell to verify encoding was preserved
string cellValue = sheet["A1"].StringValue;

// Save the converted Excel file
workbook.SaveAs("encoded-output.xlsx");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Plik wyjściowy XLSX

C# CSV do XLSX: Kompletny przewodnik dla programistów: Obraz 2 – CSV do XLSX z obsługą wszystkich kodowań

IronXL automatycznie wykrywa popularne formaty kodowania, w tym UTF-8, w większości standardowych plików CSV. W przypadku plików o niestandardowym kodowaniu, takich jak Windows-1252, ISO-8859-1 lub Shift-JIS, należy przekazać instancję System.Text.Encoding do wywołania LoadCSV. Dokumentacja klasy Encoding w serwisie Microsoft Learn zawiera listę wszystkich obsługiwanych nazw kodowań.

Podczas pobierania danych CSV ze zdalnego serwera należy użyć HttpClient, aby pobrać strumień, zapisać go jako plik tymczasowy, a następnie załadować za pomocą LoadCSV. Ten wzorzec sprawdza się w aplikacjach .NET hostowanych w chmurze, gdzie pliki CSV przychodzą jako odpowiedzi HTTP z zewnętrznych interfejsów API.

Jak zastosować formatowanie komórek po konwersji pliku CSV?

Surowe dane CSV nie zawierają informacji o formatowaniu. Po konwersji do formatu XLSX zastosuj formaty liczb, czcionki i kolory tła, aby arkusz kalkulacyjny był czytelny i wyglądał Professional.

using IronXL;
using IronXl.Styles;

// Load CSV data
WorkBook workbook = WorkBook.LoadCSV("sales-report.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

WorkSheet sheet = workbook.DefaultWorkSheet;

// Format the header row with bold text and background color
Range headerRow = sheet["A1:Z1"];
headerRow.Style.Font.Bold = true;
headerRow.Style.SetBackgroundColor("#4472C4");
headerRow.Style.Font.Color = "#FFFFFF";

// Apply currency format to a numeric column
Range priceColumn = sheet["C2:C100"];
priceColumn.Style.NumberFormat = "$#,##0.00";

// Auto-fit column widths for readability
sheet.AutoSizeColumn(0);
sheet.AutoSizeColumn(1);
sheet.AutoSizeColumn(2);

workbook.SaveAs("formatted-report.xlsx");
using IronXL;
using IronXl.Styles;

// Load CSV data
WorkBook workbook = WorkBook.LoadCSV("sales-report.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

WorkSheet sheet = workbook.DefaultWorkSheet;

// Format the header row with bold text and background color
Range headerRow = sheet["A1:Z1"];
headerRow.Style.Font.Bold = true;
headerRow.Style.SetBackgroundColor("#4472C4");
headerRow.Style.Font.Color = "#FFFFFF";

// Apply currency format to a numeric column
Range priceColumn = sheet["C2:C100"];
priceColumn.Style.NumberFormat = "$#,##0.00";

// Auto-fit column widths for readability
sheet.AutoSizeColumn(0);
sheet.AutoSizeColumn(1);
sheet.AutoSizeColumn(2);

workbook.SaveAs("formatted-report.xlsx");
Imports IronXL
Imports IronXl.Styles

' Load CSV data
Dim workbook As WorkBook = WorkBook.LoadCSV("sales-report.csv", fileFormat:=ExcelFileFormat.XLSX, ListDelimiter:=",")

Dim sheet As WorkSheet = workbook.DefaultWorkSheet

' Format the header row detecting bold header detecting bold detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting bold text detecting
$vbLabelText   $csharpLabel

IronXL udostępnia stylizację komórek i zakresów poprzez właściwość Style, która odzwierciedla opcje formatowania dostępne w interfejsie użytkownika programu Excel. Formaty liczb są zgodne ze składnią formatów liczb w programie Excel opisaną przez firmę Microsoft. Metoda SetBackgroundColor akceptuje sześciokrotne ciągi znaków kolorów, co ułatwia stosowanie kolorów marki w generowanych raportach. Zobacz pełną dokumentację API formatowania komórek, aby zapoznać się z dostępnymi właściwościami stylu.

Jak dodać wykresy po konwersji danych CSV?

Gdy dane CSV znajdą się w skoroszycie programu Excel, IronXL umożliwia tworzenie wykresów bezpośrednio na podstawie tych danych. Wykresy przekształcają surowe dane liczbowe w wizualne informacje bez konieczności instalowania programu Microsoft Excel na serwerze.

using IronXL;
using IronXl.Drawing.Charts;

// Load CSV and convert to Excel format
WorkBook workbook = WorkBook.LoadCSV("sales-data.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

WorkSheet worksheet = workbook.DefaultWorkSheet;

// Create a column chart from the converted CSV data
IChart chart = worksheet.CreateChart(ChartType.Column, 10, 0, 25, 10);

// Add data series from the worksheet ranges
IChartSeries series = chart.AddSeries("A2:A10", "B2:B10");
series.Title = "Monthly Sales";

// Configure chart appearance
chart.SetTitle("Sales Performance");
chart.SetLegendPosition(LegendPosition.Bottom);

// Plot the chart and save the workbook
chart.Plot();
workbook.SaveAs("sales-with-chart.xlsx");
using IronXL;
using IronXl.Drawing.Charts;

// Load CSV and convert to Excel format
WorkBook workbook = WorkBook.LoadCSV("sales-data.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

WorkSheet worksheet = workbook.DefaultWorkSheet;

// Create a column chart from the converted CSV data
IChart chart = worksheet.CreateChart(ChartType.Column, 10, 0, 25, 10);

// Add data series from the worksheet ranges
IChartSeries series = chart.AddSeries("A2:A10", "B2:B10");
series.Title = "Monthly Sales";

// Configure chart appearance
chart.SetTitle("Sales Performance");
chart.SetLegendPosition(LegendPosition.Bottom);

// Plot the chart and save the workbook
chart.Plot();
workbook.SaveAs("sales-with-chart.xlsx");
Imports IronXL
Imports IronXl.Drawing.Charts

' Load CSV and convert to Excel format
Dim workbook As WorkBook = WorkBook.LoadCSV("sales-data.csv", fileFormat:=ExcelFileFormat.XLSX, ListDelimiter:=",")

Dim worksheet As WorkSheet = workbook.DefaultWorkSheet

' Create a column chart from the converted CSV data
Dim chart As IChart = worksheet.CreateChart(ChartType.Column, 10, 0, 25, 10)

' Add data series from the worksheet ranges
Dim series As IChartSeries = chart.AddSeries("A2:A10", "B2:B10")
series.Title = "Monthly Sales"

' Configure chart appearance
chart.SetTitle("Sales Performance")
chart.SetLegendPosition(LegendPosition.Bottom)

' Plot the chart and save the workbook
chart.Plot()
workbook.SaveAs("sales-with-chart.xlsx")
$vbLabelText   $csharpLabel

Wynik

C# CSV do XLSX: Kompletny przewodnik dla programistów: Ilustracja 3 – Wynik konwersji pliku CSV do pliku Excel z wykresem

Metoda CreateChart przyjmuje typ wykresu oraz cztery parametry pozycjonowania (górny wiersz, lewa kolumna, dolny wiersz, prawa kolumna). Metoda AddSeries łączy zakresy komórek arkusza z osiami wykresu, tworząc dynamiczne wizualizacje, które aktualizują się wraz ze zmianami danych bazowych. IronXL obsługuje wykresy kolumnowe, słupkowe, liniowe, warstwowe i kołowe poprzez wyliczenie ChartType. Pełna lista obsługiwanych konfiguracji wykresów znajduje się w samouczku dotyczącym wykresów IronXL.

Jak przekonwertować plik CSV do tabeli danych, a następnie do programu Excel?

W sytuacjach wymagających manipulacji danymi przed eksportem konwersja danych CSV za pomocą DataTable zapewnia maksymalną elastyczność. Takie podejście pozwala programistom filtrować, przekształcać, sortować lub weryfikować wiersze podczas procesu konwersji przy użyciu standardowych wzorców dostępu do danych .NET Standard.

using IronXL;
using System.Data;

// Load CSV file into workbook
WorkBook sourceWorkbook = WorkBook.LoadCSV("input.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

// Convert worksheet to DataTable for manipulation
DataTable table = sourceWorkbook.DefaultWorkSheet.ToDataTable(true);

// Filter rows -- keep only rows where the third column value is greater than 100
DataRow[] filtered = table.Select("Column3 > 100");
DataTable filteredTable = filtered.Length > 0 ? filtered.CopyToDataTable() : table.Clone();

// Create new workbook from modified data
WorkBook outputWorkbook = WorkBook.Create(ExcelFileFormat.XLSX);
WorkSheet outputSheet = outputWorkbook.CreateWorkSheet("Processed Data");

// Import filtered DataTable back into Excel
outputSheet.LoadFromDataTable(filteredTable, true);

// Save the final XLSX file
outputWorkbook.SaveAs("processed-output.xlsx");
using IronXL;
using System.Data;

// Load CSV file into workbook
WorkBook sourceWorkbook = WorkBook.LoadCSV("input.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

// Convert worksheet to DataTable for manipulation
DataTable table = sourceWorkbook.DefaultWorkSheet.ToDataTable(true);

// Filter rows -- keep only rows where the third column value is greater than 100
DataRow[] filtered = table.Select("Column3 > 100");
DataTable filteredTable = filtered.Length > 0 ? filtered.CopyToDataTable() : table.Clone();

// Create new workbook from modified data
WorkBook outputWorkbook = WorkBook.Create(ExcelFileFormat.XLSX);
WorkSheet outputSheet = outputWorkbook.CreateWorkSheet("Processed Data");

// Import filtered DataTable back into Excel
outputSheet.LoadFromDataTable(filteredTable, true);

// Save the final XLSX file
outputWorkbook.SaveAs("processed-output.xlsx");
Imports IronXL
Imports System.Data

' Load CSV file into workbook
Dim sourceWorkbook As WorkBook = WorkBook.LoadCSV("input.csv", fileFormat:=ExcelFileFormat.XLSX, ListDelimiter:=",")

' Convert worksheet to DataTable for manipulation
Dim table As DataTable = sourceWorkbook.DefaultWorkSheet.ToDataTable(True)

' Filter rows -- keep only rows where the third column value is greater than 100
Dim filtered As DataRow() = table.Select("Column3 > 100")
Dim filteredTable As DataTable = If(filtered.Length > 0, filtered.CopyToDataTable(), table.Clone())

' Create new workbook from modified data
Dim outputWorkbook As WorkBook = WorkBook.Create(ExcelFileFormat.XLSX)
Dim outputSheet As WorkSheet = outputWorkbook.CreateWorkSheet("Processed Data")

' Import filtered DataTable back into Excel
outputSheet.LoadFromDataTable(filteredTable, True)

' Save the final XLSX file
outputWorkbook.SaveAs("processed-output.xlsx")
$vbLabelText   $csharpLabel

Wynik

C# CSV do XLSX: Kompletny przewodnik dla programistów: Ilustracja 4 – Konwersja pliku CSV do tabeli danych (DataTable) i na plik XLSX

Metoda ToDataTable eksportuje dane z arkusza do obiektu .NET DataTable, przy czym parametr logiczny określa, czy pierwszy wiersz jest traktowany jako nagłówki kolumn. LoadFromDataTable importuje dane z powrotem, zapisując nagłówki kolumn jako pierwszy wiersz, gdy drugim parametrem jest true. Ta dwukierunkowa konwersja umożliwia pełne wykorzystanie operacji LINQ i ADO.NET między pobieraniem danych z plików CSV a eksportem do programu Excel. Zapoznaj się z dokumentacją IronXL DataTable, aby poznać dodatkowe opcje.

Jak zapisać plik XLSX do strumienia zamiast do ścieżki pliku?

Aplikacje po stronie serwera często muszą dostarczać pliki Excel bezpośrednio w ramach odpowiedzi HTTP, zamiast zapisywać pliki tymczasowe na dysku. W tym celu IronXL obsługuje zapisywanie skoroszytów w formacie MemoryStream.

using IronXL;
using System.IO;

// Load and convert CSV data
WorkBook workbook = WorkBook.LoadCSV("report-data.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

WorkSheet sheet = workbook.DefaultWorkSheet;

// Save workbook to a memory stream instead of a file
using MemoryStream stream = new MemoryStream();
workbook.SaveAs(stream);

// Reset stream position for reading
stream.Position = 0;

// The stream is now ready to pass to an HTTP response, upload to cloud storage,
// or attach to an email. For ASP.NET Core:
// return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "report.xlsx");

// Write bytes to verify stream contains XLSX data
byte[] xlsxBytes = stream.ToArray();
Console.WriteLine($"Generated XLSX size: {xlsxBytes.Length} bytes");
using IronXL;
using System.IO;

// Load and convert CSV data
WorkBook workbook = WorkBook.LoadCSV("report-data.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

WorkSheet sheet = workbook.DefaultWorkSheet;

// Save workbook to a memory stream instead of a file
using MemoryStream stream = new MemoryStream();
workbook.SaveAs(stream);

// Reset stream position for reading
stream.Position = 0;

// The stream is now ready to pass to an HTTP response, upload to cloud storage,
// or attach to an email. For ASP.NET Core:
// return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "report.xlsx");

// Write bytes to verify stream contains XLSX data
byte[] xlsxBytes = stream.ToArray();
Console.WriteLine($"Generated XLSX size: {xlsxBytes.Length} bytes");
Imports IronXL
Imports System.IO

' Load and convert CSV data
Dim workbook As WorkBook = WorkBook.LoadCSV("report-data.csv", fileFormat:=ExcelFileFormat.XLSX, ListDelimiter:=",")

Dim sheet As WorkSheet = workbook.DefaultWorkSheet

' Save workbook to a memory stream instead of a file
Using stream As New MemoryStream()
    workbook.SaveAs(stream)

    ' Reset stream position for reading
    stream.Position = 0

    ' The stream is now ready to pass to an HTTP response, upload to cloud storage,
    ' or attach to an email. For ASP.NET Core:
    ' Return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "report.xlsx")

    ' Write bytes to verify stream contains XLSX data
    Dim xlsxBytes As Byte() = stream.ToArray()
    Console.WriteLine($"Generated XLSX size: {xlsxBytes.Length} bytes")
End Using
$vbLabelText   $csharpLabel

Zapisywanie do strumienia pozwala uniknąć operacji odczytu/zapisu na dysku i eliminuje konieczność czyszczenia plików tymczasowych. Ten wzorzec jest szeroko stosowany w punktach końcowych pobierania plików ASP.NET Core, gdzie plik XLSX jest generowany na żądanie. Przeładowanie SaveAs(Stream) zapisuje kompletne, poprawne archiwum XLSX do dowolnej instancji strumienia z prawem zapisu.

Jak pracować z wieloma arkuszami w przekonwertowanym skoroszycie?

Pojedynczy skoroszyt XLSX może zawierać wiele arkuszy. Po konwersji pliku CSV skoroszyt domyślnie zawiera jeden arkusz. Dodatkowe arkusze można tworzyć programowo w celu uporządkowania powiązanych danych.

using IronXL;

// Load primary CSV data
WorkBook workbook = WorkBook.LoadCSV("quarterly-data.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

// Rename the default sheet created from the CSV
WorkSheet q1Sheet = workbook.DefaultWorkSheet;
q1Sheet.Name = "Q1 Data";

// Create additional worksheets for summary information
WorkSheet summarySheet = workbook.CreateWorkSheet("Summary");

// Write summary headers and formulas
summarySheet["A1"].Value = "Total Records";
summarySheet["B1"].Formula = $"=COUNTA('{q1Sheet.Name}'!A:A)-1";

summarySheet["A2"].Value = "Data Sheet";
summarySheet["B2"].Value = q1Sheet.Name;

// Save the multi-sheet workbook
workbook.SaveAs("multi-sheet-report.xlsx");
using IronXL;

// Load primary CSV data
WorkBook workbook = WorkBook.LoadCSV("quarterly-data.csv",
    fileFormat: ExcelFileFormat.XLSX,
    ListDelimiter: ",");

// Rename the default sheet created from the CSV
WorkSheet q1Sheet = workbook.DefaultWorkSheet;
q1Sheet.Name = "Q1 Data";

// Create additional worksheets for summary information
WorkSheet summarySheet = workbook.CreateWorkSheet("Summary");

// Write summary headers and formulas
summarySheet["A1"].Value = "Total Records";
summarySheet["B1"].Formula = $"=COUNTA('{q1Sheet.Name}'!A:A)-1";

summarySheet["A2"].Value = "Data Sheet";
summarySheet["B2"].Value = q1Sheet.Name;

// Save the multi-sheet workbook
workbook.SaveAs("multi-sheet-report.xlsx");
Imports IronXL

' Load primary CSV data
Dim workbook As WorkBook = WorkBook.LoadCSV("quarterly-data.csv", fileFormat:=ExcelFileFormat.XLSX, ListDelimiter:=",")

' Rename the default sheet created from the CSV
Dim q1Sheet As WorkSheet = workbook.DefaultWorkSheet
q1Sheet.Name = "Q1 Data"

' Create additional worksheets for summary information
Dim summarySheet As WorkSheet = workbook.CreateWorkSheet("Summary")

' Write summary headers and formulas
summarySheet("A1").Value = "Total Records"
summarySheet("B1").Formula = $"=COUNTA('{q1Sheet.Name}'!A:A)-1"

summarySheet("A2").Value = "Data Sheet"
summarySheet("B2").Value = q1Sheet.Name

' Save the multi-sheet workbook
workbook.SaveAs("multi-sheet-report.xlsx")
$vbLabelText   $csharpLabel

Metoda CreateWorkSheet dodaje nowy pusty arkusz do skoroszytu. Dostęp do arkuszy można uzyskać poprzez nazwę lub indeks za pomocą workbook.WorkSheets. Odwołania do formuł międzyarkuszowych wykorzystują standardową notację programu Excel 'SheetName'!CellRef. Więcej informacji na temat operacji z wieloma arkuszami można znaleźć w przewodniku IronXL dotyczącym wielu arkuszy.

Jakie są Twoje kolejne kroki?

Konwersja plików CSV do formatu XLSX w języku C# za pomocą IronXL wymaga zaledwie kilku wierszy kodu i pozwala uzyskać w pełni zgodny skoroszyt programu Excel bez konieczności korzystania z pakietu Microsoft Office. Powyższe przykłady obejmują cały proces — od podstawowego wczytywania i zapisywania plików CSV po obsługę kodowania, formatowanie komórek, tworzenie wykresów, integrację z DataTable, wyjście strumieniowe oraz skoroszyty wielarkuszowe.

Kluczowe funkcje omówione w tym przewodniku:

  • Podstawowa konwersja plików CSV do formatu XLSX za pomocą WorkBook.LoadCSV i SaveAs
  • Specyfikacja kodowania dla międzynarodowych zestawów znaków
  • Formatowanie komórek i zakresów zastosowane po konwersji
  • Tworzenie wykresów bezpośrednio w pliku XLSX
  • Przetwarzanie w obie strony w DataTable dla danych przefiltrowanych i przekształconych
  • Wyjście MemoryStream do dostarczania plików po stronie serwera
  • Tworzenie skoroszytów wielarkuszowych na podstawie pojedynczego źródła CSV

IronXL obsługuje wdrożenia w systemach Windows, Linux, macOS, Docker i Azure w ramach platform .NET Framework, .NET Core oraz .NET 5–10. Aby poznać więcej możliwości, zapoznaj się z dokumentacją IronXL, przejrzyj Dokumentację API programu Excel lub sprawdź poradniki IronXL dotyczące takich tematów, jak odczytywanie plików Excel, scałanie komórek i stosowanie formuł. Pobierz bezpłatną wersję próbną, aby przetestować wszystkie funkcje w środowisku programistycznym, lub kup licencję na wdrożenie produkcyjne.

!{--01001100010010010100001001010010010000010101001001011001010111110100011101000101010101000101111101010011010101000100000101010010010101000100010101000100010111110101011101001001010100010010000101111101010000010100100100111101000100010101010100001101010100010111110101010001010010010010010100000101001100010111110100001001001100010011110100001101001011--}

Często Zadawane Pytania

Jak przekonwertować plik CSV na XLSX w języku C# bez korzystania z pakietu Microsoft Office?

Użyj metody WorkBook.LoadCSV biblioteki IronXL, aby załadować plik CSV, a następnie wywołaj workbook.SaveAs('output.xlsx'), aby zapisać plik XLSX. Biblioteka IronXL nie wymaga pakietu Microsoft Office ani zestawu Open XML SDK — odczytuje i zapisuje pliki Excel przy użyciu własnego parsera.

Jakiego pakietu NuGet używa się do konwersji plików CSV do formatu Excel w języku C#?

Zainstaluj pakiet IronXL NuGet za pomocą polecenia „Install-Package IronXL” w Visual Studio lub „dotnet add package IronXL” z poziomu interfejsu CLI .NET. Pakiet jest przeznaczony dla platformy .NET Framework 4.6.2+ oraz wszystkich środowisk uruchomieniowych .NET Core i .NET 5–10.

Jak określić separator podczas ładowania pliku CSV za pomocą IronXL?

Przekaż parametr ListDelimiter do metody WorkBook.LoadCSV, na przykład: WorkBook.LoadCSV('data.csv', fileFormat: ExcelFileFormat.XLSX, ListDelimiter: ',') dla plików rozdzielonych przecinkami lub ListDelimiter: ';' dla plików rozdzielonych średnikami.

Czy IronXL obsługuje pliki CSV zawierające znaki spoza zestawu ASCII lub znaki międzynarodowe?

Tak. Przekaż instancję System.Text.Encoding do parametru encoding metody LoadCSV. IronXL automatycznie wykrywa kodowanie UTF-8 dla większości standardowych plików. W przypadku kodowań Windows-1252, ISO-8859-1 lub innych należy jawnie określić kodowanie, aby zachować znaki międzynarodowe.

Jak dodać wykres do pliku Excel wygenerowanego na podstawie danych CSV przy użyciu IronXL?

Po załadowaniu pliku CSV wywołaj worksheet.CreateChart(ChartType.Column, top, left, bottom, right), aby utworzyć wykres, a następnie użyj chart.AddSeries, aby połączyć zakresy komórek, i wywołaj chart.Plot() przed zapisaniem. IronXL obsługuje wykresy kolumnowe, słupkowe, liniowe, warstwowe i kołowe.

Jak zapisać wygenerowany plik XLSX do strumienia pamięci (MemoryStream) w celu wysłania odpowiedzi HTTP w ASP.NET Core?

Wywołaj metodę workbook.SaveAs(stream), gdzie stream jest instancją MemoryStream, a następnie zresetuj stream.Position do 0 przed zwróceniem go. W kontrolerze .NET Core zwróć File(stream, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'report.xlsx').

Czy IronXL może konwertować dane CSV do tabeli danych (DataTable) przed zapisaniem ich w Excelu?

Tak. Załaduj plik CSV za pomocą LoadCSV, a następnie wywołaj metodę workbook.DefaultWorkSheet.ToDataTable(true), aby wyeksportować dane do tabeli DataTable. Po przefiltrowaniu lub przekształceniu danych utwórz nowy skoroszyt i wywołaj metodę outputSheet.LoadFromDataTable(table, true), aby zaimportować zmodyfikowane dane.

Czy IronXL obsługuje wiele arkuszy podczas konwersji z formatu CSV?

Tak. Po załadowaniu pliku CSV skoroszyt zawiera jeden domyślny arkusz. Aby dodać dodatkowe arkusze, należy wywołać funkcję workbook.CreateWorkSheet('SheetName'). Arkusze mogą odwoływać się do siebie nawzajem przy użyciu standardowej składni formuł międzyarkuszowych programu Excel.

Jakie wersje .NET i platformy obsługuje IronXL?

IronXL obsługuje .NET Framework 4.6.2 i nowsze wersje, .NET Core 3.1 oraz .NET 5 do .NET 10. Działa na systemach Windows, Linux, macOS, Docker i Azure, dzięki czemu nadaje się zarówno do wdrożeń po stronie klienta, jak i po stronie serwera.

Jak zastosować formatowanie komórek, takie jak pogrubione nagłówki i formaty liczb, po konwersji pliku CSV?

Po załadowaniu pliku CSV należy uzyskać dostęp do zakresu za pomocą sheet['A1:Z1'] i ustawić Style.Font.Bold = true, Style.SetBackgroundColor('#hex') lub Style.NumberFormat = '$#,##0.00'. IronXl.Excel udostępnia pełny interfejs API stylów programu Excel poprzez właściwość Style w komórkach i zakresach.

Jordi Bardia
Inżynier oprogramowania
Jordi jest najbardziej biegły w Pythonie, C# i C++. Kiedy nie wykorzystuje swoich umiejętności w Iron Software, programuje gry. Dzieląc odpowiedzialność za testowanie produktów, rozwój produktów i badania, Jordi wnosi ogromną wartość do ciągłej poprawy produktów. Różnorodne doświadczenia ...
Czytaj więcej

Zespol wsparcia Iron

Jestesmy online 24 godziny, 5 dni w tygodniu.
Czat
Email
Zadzwon do mnie