Hi,
If it is just a matter of presentation you can use String.Format() method.
String.Format Method (System) | Microsoft Learn[
^]
But you can also query an Excel file directly without importing it in text format. I got this example (sorry it is in French) from Bing. It reads data from an Excel sheet and put it in a DataSet. (but i am not a C# guy.)
using System.Data;
using System.Data.OleDb;
string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\myFolder\\myExcel2007file.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES;\"";
string query = "SELECT * FROM [Sheet1$]";
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString);
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
Dans cet exemple, le fichier Excel est situé dans le dossier C:\myFolder et s’appelle myExcel2007file.xlsx. La requête SQL sélectionne toutes les colonnes et toutes les lignes de la feuille Sheet1.