In my datatable, I have to append Global titles with TADIG, E.212, E.214

I have attached what I have getting from Sample text

But Each TADIG have different network nodes global title I Need append them

My Input

Need Output like:

image

Each TADIG have to global title so have to append two times with TADIG and E.212 and E.214

Sample Text File

Sample.txt (705.5 KB)

Thanks
Shaik

@shaik.muktharvalli1

Do you want to duplicate everyrow? Is that the ask?

Cheers

Yes @Anil_G

Thanks
Shaik

@shaik.muktharvalli1

try this in assign activity

dt = dt.AsEnumerable.SelectMany(function(x,i) {dt.rows(i),dt.rows(i)}).CopyToDataTable

dt is the datatable variable

cheers

I need to append depends upon number of Global title

Suppose

Each TADIG have mutiple global title then Have to append upto global title numbers

@shaik.muktharvalli1

Did not get your request properly

cheers

Hi,
Use this c# code to achieve expected result:-

// 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