In my previous blog post, I presented a simple Perl application that addressed the tedious and difficult task one encounters when importing data into ClearQuest; that is, determining how to define the data types of fields within a ClearQuest record. If the data types are defined incorrectly, the import of data will fail because of a type mismatch and you will need to modify your ClearQuest schema to correct the issue.
The previously posted ClearQuest Import Assistant did a very simple parse of a CSV file and produced a recommendation for how to correctly define the ClearQuest data types.
I’ve modified that previously posted ClearQuest Import Assistant to improve the robustness of the CSV parsing by using the Parse::CSV package available from CPAN and to expand the capabilities of the app by introducing the ability to operate on XML files.
In the previous blog entry, we considered a 10,000+ line CSV file where each line represented a record to be imported into ClearQuest. Now consider the following 10,000 records of XML data to be imported into ClearQuest:
It would be difficult to visually parse this data to determine the data type for each of the many fields to be imported into ClearQuest. However, the ClearQuest XML and CSV Import Assistant will parse the entire 10,000+ XML records and provide recommendations on how to define your ClearQuest data types.
Below is an example of running the ClearQuest XML and CSV Import Assistant against our sample data:
In this example, we see that the ClearQuest XML and CSV Import Assistant has parsed the XML data, performed some analysis on it and has provided recommendations for how to define the right ClearQuest data type for each field to be imported.
By running this Perl application on your CSV or XML data prior to importing into ClearQuest, you can save a great deal of time and effort in defining your ClearQuest schema and importing your data into ClearQuest.
The source code for this application is provided below so that you can use it as-is or modify it to meet your specific needs.
Senior Area Sales Director, Software Change and Configuration Management
Connect with me on LinkedIn