// Assuming dtInput is your input DataTable and dtOutput is your output DataTable
// Clone the structure of dtInput to dtOutput
DataTable dtOutput = dtInput.Clone();
// Add the first row as it is to dtOutput
dtOutput.ImportRow(dtInput.Rows[0]);
// Use LINQ to duplicate rows based on the condition
var duplicatedRows = from DataRow row in dtInput.Rows.Cast().Skip(1)
from i in Enumerable.Range(0, Convert.ToInt32(row[1]))
select row;
// Add the duplicated rows to dtOutput
foreach (DataRow row in duplicatedRows)
{
dtOutput.ImportRow(row);
}
// Now dtOutput contains the desired output DataTable