Excel to Xml

Hi, I need to convert an excel file with many records to xml, if possible save each record in a different xml file, thank you very much.

1 Like

Hey @manuel.rojas

Of course yes that’s possible you can use any XML parser for the same.

DataTable.WriteXML

Thanks
#nK

1 Like

@manuel.rojas Try this

1 Like

this video has been very helpful, thank you very much.

However I have not managed to save a file for each record, ie if I have 100 records, I can save each record in a different xml file, ie 100 xml files, could you help me?

It has been very helpful, thank you very much. However I have not managed to save a file for each record, ie if I have 100 records, I can save each record in a different xml file, ie 100 xml files, could you help me?

Hey @manuel.rojas

Now you need to split this XML and save it in separate files.

Thanks
#nK

That’s right, do you know how this process is done?

1 Like

Could you please show your current last step ?

I send you the file?

Hey @manuel.rojas

Screenshot or file should work ?

Thanks
#nK

Better is to formulate such a request within an IPO Pattern
I - Input
P - Processing description / requirements
O - expected output / result

As we dont have any IPO so lets work with a standard. Kindly note: Custom XML structure we can build by API or with the help of XSL Transformations XSLT Transformation

input sample
grafik

Variables:

Flow:

details:
tmpDT = {row}.CopyToDataTable
tmpDT.TableName = dtData.TableName & idx.ToString.PadLeft(3,"0"c)

Result:
grafik

Output sample:
grafik

Kindly note:

  • we can adopt / customize when we do know more details
  • the export directory has to present / created before the export
  • the table name we used for several reasons e.g. for namings

Find starter help here:
SplitDT_EachRow_ToXMLFile.xaml (9.5 KB)

That’s right, however it is not a datatable if not, with an excel with data, when I changed the datatable it did not work, I need to do that same thing you did but with this excel.

Ejemplo base.xlsx (20.7 KB)
Main.xaml (12.1 KB)

we just added your read range to the flow:

and it was working:
grafik

this is why we called to tell us the expected output as you are looking for a custom structure

you will need to construct the entire XML within the for each loop and will have to write it out before constructing the next XML within the next iteration


so does mean bring it inside

At the moment the project is like this, I have not been able to do what you indicated.

Main.xaml (16.0 KB)

If you want to run it and check what it generates.

you want to write for each row a seperate XML, right?
Then we would recommend to construct the entire corresponding xml for the row within the for each row block and write it out on the loop end. You are very close to have it done, just only a few little rearrangements are to do

Exactly what I need to do, but I have not been able to do it following the steps you indicated, could you help me?