Submissions must be posted in this thread no later than the 2023-12-03T21:59:00Z, your time-zone.
For all the community enthusiasts out there: while some eagerly await the arrival of snow , others let their minds wander to tropical weather , please go ahead, download the pdf challenge , and start submitting your creative submissions.
We appreciate your cooperation in providing the required information and materials for your submission:
Share the link to your code repository or furnish the actual code files if not submitting directly on the UiPath Community Forum.
Clearly outline any dependencies necessary for running the code.
Submit thorough documentation encompassing an overview of the solution, a breakdown of the code structure, and explanations for each module or function.
Provide details on the setup and execution of the automation, including any required configuration steps.
Share your insights into specific strategies or algorithms implemented to optimize the efficiency of the automation.
The instructions are wrong guys.
The output you show as expected has the data re-arranged but the column names are not, so the LastName data is in the column for Age
So since the goal I think is to share knowledge and ideas with the community, I will explain some of the design choices I make in this which are missing in some others so far I have seen or include features I don’t think get enough appreciation, such as testing.
I have had the input for this be an argument, not just the FilePath to the input but also the column order. This is to make the project flexible and re-usable so we could handle multiple file locations and multiple column layouts as needed so this can re-order any CSV. There is an argument to also include the csv separator.
After that I am re-arranging by reading the CSV to a datatable (I have that I need the Excel activities for this) and then setting the column position using ‘SetOrdinal’. This sets the column position in a data table. This requires the Invoke Method activity as SetOrdinal is a method of a Column.
After that I considered Testability so I made a TestCase for the Main.
I added data variations to this test data so I could test with other files should I need to.
I also have an expected result so I can validate the correct output is generated.
I wanted the Test Case to be able to execute without me needing to have a human interact with it so it could for example still work in a build pipeline or test dozens of files at once.
The message box in the requirements prevents this so I mocked the main so that the generated text goes to a log message and a new output argument so the Test can verify it, in this way my tests can run on their own.
Reads a text file line by line, splitting each line by commas to create a Datatable, ensuring that each line has the expected number of values before adding it as a DataRow to the DataTable, excluding header line. Advent Challenge (2).zip (3.7 KB)