Automatically enclosing all fields in a .csv file with double quotes for ClearQuest import
This technote explains a process using a Microsoft Excel macro to enclose all fields of a .csv file in double quotes for importing into IBM Rational ClearQuest.
Text files not created using the ClearQuest Export tool, might not be formatted correctly for use by the ClearQuest Import tool. The import file must have all fields enclosed in double quotes and separated by a comma (other acceptable delimiters are tab, pipe, semi-colon or colons).
Resolving the problem
The file ImportFormat.xls in the Related information section of this technote can be used to place double quotes around all fields in a .csv file. In order for data to be imported into ClearQuest, the import file must have all fields enclosed in double quotes and separated by a comma (other acceptable delimiters are tab, pipe, semi-colon or colons).
For example, for the following lines of text to be imported:
SAMPL000001,This is a headline,Submitted,Critical
They will need to be formatted as:
"SAMPL000001","This is a headline","Submitted","Critical"
The attached macro will easily add the double quotes to the .csv file so that the user does not have to do it manually.
To apply the macro to a file:
- Start Microsoft Excel.
- Open the attached file, ImportFormat.xls.
- Select Enable macros when the Microsoft Excel dialog box appears.
- Open the .csv file with the data that needs to be imported into Rational ClearQuest.
- Select Tools > Macro > Macros.
- Select the ImportFormat.xls!SaveCQImport macro and select Run.
- The data will be saved into a new file: C:\bugbert.csv.
- Open this file (C:\bugbert.csv) in Notepad to verify the format is in csv format.
- All fields should now be enclosed in double quotes.
- Close Excel without saving changes.
You can now proceed with the import into Rational ClearQuest by using the Rational ClearQuest Import Tool.
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. br>
Translate this page: