Saltar al pie de página
USANDO IRONXL

C# CSV a XLSX: Convertir archivos CSV a formato Excel

La conversión de archivos CSV al formato XLSX ofrece capacidades de hoja de cálculo que los archivos de valores separados por comas simplemente no pueden proporcionar. Mientras que el CSV almacena datos tabulares sin procesar, el formato XLSX de Excel admite fórmulas, hojas de cálculo múltiples, gráficos, formato de celdas y validación de datos, características que exigen las aplicaciones empresariales modernas. El proceso de conversión es sencillo con la biblioteca adecuada y solo requiere unas pocas líneas de código C#.

IronXL es una biblioteca .NET que gestiona esta conversión directamente, sin necesidad de Microsoft Office ni del SDK de Open XML. Lee el archivo CSV de origen, analiza los datos delimitados y escribe un libro de Excel XLSX totalmente compatible. Instálalo a través de NuGet y empieza una prueba gratuita para seguir los ejemplos de código que se muestran a continuación.

¿Cómo se convierten archivos CSV a formato XLSX en C#?

La conversión principal requiere cargar el archivo CSV y guardarlo en formato Excel. IronXL proporciona WorkBook.LoadCSV, que analiza el código fuente delimitado y crea un libro de trabajo listo para exportar. El método acepta la ruta del archivo, el formato Excel de destino y el carácter delimitador.

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

Resultado

C# CSV a XLSX: Una guía completa para desarrolladores: Imagen 1 - Ejemplo de resultado de la conversión de CSV a Excel

El método LoadCSV acepta tres parámetros clave: el nombre del archivo, la constante del formato Excel de destino y el delimitador de lista utilizado en el archivo de origen. Este enfoque conserva todos los datos de cadena y valores numéricos de la hoja CSV original al tiempo que crea un archivo XLSX correctamente estructurado. La clase WorkBook sirve como centro neurálgico para todas las operaciones de la hoja de cálculo. Una vez cargados, los datos CSV se vuelven accesibles a través de hojas de cálculo, lo que permite una mayor manipulación antes de guardar el archivo final de Excel.

Para cargar archivos XLSX existentes en lugar de CSV, utilice WorkBook.Load("file.xlsx"), que detecta automáticamente el formato a partir de la extensión del archivo. Esto facilita la creación de flujos de trabajo que acepten entradas en formato CSV o Excel y las normalicen a un único formato de salida.

¿Cuáles son los beneficios de convertir formato CSV a Excel?

El formato XLSX ofrece ventajas cuantificables sobre el CSV sin formato en la mayoría de los escenarios de gestión de datos:

  • Hojas de cálculo múltiples: los archivos de Excel admiten varias hojas dentro de un mismo libro, lo que permite un almacenamiento organizado de datos que los archivos CSV no pueden igualar. Un único archivo XLSX puede contener docenas de hojas de cálculo que abarcan diferentes periodos de tiempo, regiones o categorías.
  • Compatibilidad con fórmulas: Escribe cálculos complejos, agregaciones y lógica condicional directamente en las celdas. Las fórmulas de Excel se recalculan automáticamente cuando cambian los datos de origen, lo que elimina la necesidad de volver a procesar los archivos CSV manualmente.
  • Visual Charts: Crea gráficos de barras, gráficos de líneas, gráficos circulares y otras visualizaciones a partir de datos de hojas de cálculo. IronXL admite la creación de gráficos directamente a través de la API, por lo que los gráficos se incrustan en el archivo XLSX.
  • Formato de celdas: Controle las fuentes, los colores, los bordes y los formatos numéricos para crear documentos profesionales. Los archivos CSV solo almacenan valores sin procesar; XLSX conserva la capa de visualización junto con los datos.
  • Validación de datos: Restringe la entrada en las celdas a valores o rangos específicos, evitando errores de introducción de datos en los archivos compartidos con los usuarios finales.
  • Protección con contraseña: Proteja hojas de cálculo y libros con contraseñas para controlar el acceso de lectura y escritura, una característica totalmente ausente en CSV.

Estas capacidades convierten al formato XLSX en la opción estándar para informes, paneles de control, modelos financieros y cualquier aplicación que requiera algo más que el almacenamiento de datos sin procesar.

¿Cómo instalar IronXL en un proyecto .NET ?

IronXL se distribuye como un paquete NuGet. Instálalo desde la consola del gestor de paquetes en Visual Studio:

Install-Package IronXl
Install-Package IronXl
SHELL

O utilizando la CLI de .NET:

dotnet add package IronXl
dotnet add package IronXl
SHELL

Tras la instalación, añada using IronXL; a cualquier archivo que trabaje con hojas de cálculo. El paquete está destinado a .NET Framework 4.6.2+, .NET Core 3.1+, .NET 5 hasta .NET 10, y es compatible con entornos de implementación de Windows, Linux, macOS, Docker y Azure.

No se requieren dependencias de tiempo de ejecución adicionales ni la instalación de Microsoft Office. IronXL lee y escribe archivos XLSX utilizando su propio analizador y generador, lo que lo hace adecuado para implementaciones del lado del servidor y sin interfaz gráfica, donde no se puede instalar Office.

¿Cómo se maneja la codificación CSV durante la conversión?

Muchos archivos CSV proceden de sistemas heredados, bases de datos internacionales o exportaciones de terceros que utilizan caracteres no ASCII. El manejo correcto de la codificación garantiza que los caracteres especiales y el texto internacional se mantengan intactos en el archivo XLSX resultante.

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

Archivo XLSX de salida

C# CSV a XLSX: Una guía completa para desarrolladores: Imagen 2 - CSV a XLSX con toda la codificación gestionada

IronXL detecta automáticamente los formatos de codificación más comunes, incluido UTF-8, para la mayoría de los archivos CSV estándar. Para archivos con codificación no estándar, como Windows-1252, ISO-8859-1 o Shift-JIS, pase la instancia System.Text.Encoding a la llamada LoadCSV. La documentación de la clase Encoding en Microsoft Learn enumera todos los nombres de codificación compatibles.

Al recuperar datos CSV de un servidor remoto, utilice HttpClient para descargar el flujo, guárdelo como un archivo temporal y, a continuación, cárguelo mediante LoadCSV. Este patrón funciona en aplicaciones .NET alojadas en la nube en las que los archivos CSV llegan como respuestas HTTP desde API de terceros.

¿Cómo se aplica el formato de celda tras la conversión a CSV?

Los datos CSV sin procesar no contienen información de formato. Tras la conversión a XLSX, aplique formatos numéricos, fuentes y colores de fondo para que la hoja de cálculo resulte legible y tenga un aspecto 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 permite aplicar estilos a celdas y rangos mediante la propiedad Style, que refleja las opciones de formato disponibles en la interfaz de usuario de Excel. Los formatos numéricos siguen la sintaxis de formato numérico de Excel documentada por Microsoft. El método SetBackgroundColor acepta cadenas de color hexadecimales, lo que facilita la aplicación de los colores de marca a los informes generados. Consulte la referencia completa de la API de formato de celdas para ver las propiedades de estilo disponibles.

¿Cómo puedes agregar gráficos después de convertir datos CSV?

Una vez que los datos CSV se encuentran en un libro de Excel, IronXL permite crear gráficos directamente a partir de esos datos. Los gráficos transforman los datos brutos en información visual sin necesidad de instalar Microsoft Excel en el servidor.

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

Resultado

C# CSV a XLSX: Una guía completa para desarrolladores: Imagen 3 - Resultado de la conversión de un archivo CSV a un archivo de Excel con un gráfico

El método CreateChart acepta el tipo de gráfico y cuatro parámetros de posicionamiento (fila superior, columna izquierda, fila inferior, columna derecha). El método AddSeries vincula rangos de celdas de una hoja de cálculo a los ejes de un gráfico, creando visualizaciones dinámicas que se actualizan cuando cambian los datos subyacentes. IronXL admite gráficos de columnas, barras, líneas, áreas y circulares a través de la enumeración ChartType. Para obtener una lista completa de las configuraciones de gráficos compatibles, consulte el tutorial de gráficos de IronXL.

¿Cómo se convierte un CSV a una DataTable y luego a Excel?

En los casos en los que sea necesario manipular los datos antes de la exportación, la conversión de datos CSV mediante un DataTable ofrece la máxima flexibilidad. Este enfoque permite a los desarrolladores filtrar, transformar, ordenar o validar filas durante el proceso de conversión utilizando patrones estándar de acceso a datos de .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

Resultado

C# CSV a XLSX: Una guía completa para desarrolladores: Imagen 4 - CSV a DataTable a salida XLSX

El método ToDataTable exporta datos de la hoja de cálculo a un DataTable de .NET, y el parámetro booleano controla si la primera fila se trata como encabezados de columna. LoadFromDataTable importa los datos de nuevo, escribiendo los encabezados de columna como la primera fila cuando el segundo parámetro es true. Esta conversión bidireccional permite el uso completo de las operaciones LINQ y ADO.NET entre la importación de CSV y la exportación a Excel. Consulte la documentación de IronXL DataTable para ver opciones adicionales.

¿Cómo se ahorra un archivo XLSX en un flujo en lugar de en una ruta de archivo?

Las aplicaciones del lado del servidor a menudo necesitan entregar archivos Excel directamente en respuestas HTTP en lugar de escribir archivos temporales en el disco. IronXL admite el guardado de libros de trabajo en MemoryStream para este fin.

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

Ahorrar en un flujo evita las operaciones de lectura/escritura en disco y elimina la necesidad de limpiar archivos temporales. Este patrón se utiliza ampliamente en los puntos finales de descarga de archivos de .NET Core, donde el XLSX se genera bajo demanda. La sobrecarga SaveAs(Stream) escribe un archivo XLSX completo y válido en cualquier instancia de flujo de escritura.

¿Cómo se trabaja con varias hojas de cálculo en un libro de trabajo convertido?

Un único libro de Excel (XLSX) puede contener varias hojas de cálculo. Tras convertir un archivo CSV, el libro contiene una hoja de forma predeterminada. Se pueden crear hojas adicionales mediante programación para organizar datos relacionados.

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

El método CreateWorkSheet añade una nueva hoja vacía al libro. Se puede acceder a las hojas por nombre o por índice a través de workbook.WorkSheets. Las referencias a fórmulas entre hojas utilizan la notación estándar de Excel 'SheetName'!CellRef. Para obtener más información sobre las operaciones con varias hojas, consulte la guía de hojas de cálculo múltiples de IronXL.

¿Cuales son tus próximos pasos?

Convertir archivos CSV a XLSX en C# con IronXL requiere solo unas pocas líneas de código y genera un libro de Excel totalmente compatible sin ninguna dependencia de Microsoft Office. Los ejemplos anteriores abarcan el flujo de trabajo completo, desde la carga y el guardado básico de archivos CSV hasta el manejo de la codificación, el formato de celdas, la creación de gráficos, la integración de DataTable, la salida de flujos y los libros de trabajo con varias hojas.

Capacidades clave cubiertas en esta guía:

  • Conversión básica de CSV a XLSX con WorkBook.LoadCSV y SaveAs
  • Especificación de codificación para conjuntos de caracteres internacionales
  • Formato de celdas y rangos aplicado tras la conversión
  • Creación de gráficos integrada directamente en el archivo XLSX
  • Intercambio de datos de DataTable para datos filtrados y transformados
  • Salida de MemoryStream para la entrega de archivos del lado del servidor
  • Creación de libros de trabajo de varias hojas a partir de una única fuente CSV

IronXL es compatible con implementaciones en Windows, Linux, macOS, Docker y Azure en .NET Framework, .NET Core y .NET 5 a 10. Para explorar más capacidades, consulta la documentación de IronXL, examina la referencia de objetos de la API de Excel o revisa las guías prácticas de IronXL sobre temas como la lectura de archivos de Excel, la fusión de celdas y la aplicación de fórmulas. Descargue una versión de prueba gratuita para probar todas las funciones en un entorno de desarrollo, o adquiera una licencia para su implementación en producción.

Empiece con IronXL ahora.
green arrow pointer

Preguntas Frecuentes

¿Cómo convertir un archivo CSV a XLSX en C# sin Microsoft Office?

Utilice el método WorkBook.LoadCSV de IronXL para cargar el archivo CSV y, a continuación, llame a workbook.SaveAs('output.xlsx') para escribir el archivo XLSX. IronXL no requiere Microsoft Office ni el SDK de Open XML; lee y escribe archivos de Excel con su propio analizador.

¿Qué paquete NuGet se utiliza para convertir CSV a Excel en C#?

Instale el paquete NuGet IronXL mediante " Install-Package IronXL" en Visual Studio o "dotnet add package IronXL" desde la CLI de .NET . El paquete es compatible con .NET Framework 4.6.2 y versiones posteriores, así como con todos los entornos de ejecución de .NET Core y .NET 5 a 10.

¿Cómo se especifica el delimitador al cargar un archivo CSV con IronXL?

Pase el parámetro ListDelimiter a WorkBook.LoadCSV, por ejemplo: WorkBook.LoadCSV('data.csv', fileFormat: ExcelFileFormat.XLSX, ListDelimiter: ',') para archivos separados por comas o ListDelimiter: ';' para archivos separados por punto y coma.

¿Puede IronXL manejar archivos CSV con caracteres no ASCII o internacionales?

Sí. Pase una instancia de System.Text.Encoding al parámetro de codificación de LoadCSV. IronXL detecta automáticamente UTF-8 para la mayoría de los archivos estándar. Para codificaciones Windows-1252, ISO-8859-1 u otras, especifique la codificación explícitamente para conservar los caracteres internacionales.

¿Cómo agregar un gráfico a un archivo Excel generado a partir de datos CSV usando IronXL?

Después de cargar el archivo CSV, ejecute worksheet.CreateChart(ChartType.Column, top, left, bottom, right) para crear un gráfico. Luego, use chart.AddSeries para vincular rangos de celdas y ejecute chart.Plot() antes de guardar. IronXL admite gráficos de columnas, barras, líneas, áreas y circulares.

¿Cómo guardar un archivo XLSX generado en un MemoryStream para una respuesta HTTP en ASP.NET Core?

Llama a workbook.SaveAs(stream), donde stream es una instancia de MemoryStream, y luego restablece stream.Position a 0 antes de devolverlo. En un controlador ASP.NET Core , devuelve File(stream, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'report.xlsx').

¿Puede IronXL convertir datos CSV a un DataTable antes de escribirlos en Excel?

Sí. Cargue el CSV con LoadCSV y luego ejecute workbook.DefaultWorkSheet.ToDataTable(true) para exportarlo a una DataTable. Después de filtrar o transformar los datos, cree un nuevo libro de trabajo y ejecute outputSheet.LoadFromDataTable(table, true) para importar los datos modificados.

¿ IronXL admite varias hojas de cálculo al convertir desde CSV?

Sí. Tras cargar un archivo CSV, el libro contiene una hoja predeterminada. Llame a workbook.CreateWorkSheet('SheetName') para agregar hojas adicionales. Las hojas pueden referenciarse entre sí mediante la sintaxis estándar de fórmulas de Excel para hojas cruzadas.

¿Qué versiones y plataformas .NET admite IronXL ?

IronXL es compatible con .NET Framework 4.6.2 y versiones posteriores, .NET Core 3.1 y .NET 5 a .NET 10. Funciona en Windows, Linux, macOS, Docker y Azure, lo que lo hace adecuado tanto para implementaciones de escritorio como de servidor.

¿Cómo se aplican formatos de celda como encabezados en negrita y formatos de números después de la conversión CSV?

Después de cargar el CSV, acceda a un rango con sheet['A1:Z1'] y configure Style.Font.Bold = true, Style.SetBackgroundColor('#hex') o Style.NumberFormat = '$#,##0.00'. IronXL expone la API completa de estilos de Excel mediante la propiedad Style en celdas y rangos.

Jordi Bardia
Ingeniero de Software
Jordi es más competente en Python, C# y C++. Cuando no está aprovechando sus habilidades en Iron Software, está programando juegos. Compartiendo responsabilidades para pruebas de productos, desarrollo de productos e investigación, Jordi agrega un valor inmenso a la mejora continua del producto. La experiencia variada lo mantiene ...
Leer más

Equipo de soporte de Iron

Estamos disponibles online las 24 horas, 5 días a la semana.
Chat
Email
Llámame