![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Stream to Excel Topic Summary: Created On: 20-Aug-2008 07:30 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hello
I'm creating a report file using a DXL to extract values of different attributes across the database, using Stream function. The output is csv & all the data appears in a single column of the csv file. I need to display this data in an Excel like a tabular format. I had once before asked this question in the forum few months ago & somebody had given me a tip how to go about this. But sadly, I don't remember the tip now & am unable to find that old thread too. Can someone please help? |
|
![]() |
|
![]() |
|
Sheela, after one of the updates of DOORS 8.1, Telelogic switched to UTF-8 encoding, which excel doesn't understand.
Open the csv file in notepad and save as ansi encoding. |
|
![]() |
|
![]() |
|
The stream write function can also specify the codepage to be used
write Declaration Stream write(string filename, int codepage) Operation Opens a stream onto the specified filename; content of file encoded to the specified codepage. The codepage values are defined in the DXL Help: const int CP_LATIN1 // ANSI Latin-1 const int CP_UTF8 // Unicode UTF-8 encoding Maybe the CP_LATIN1 (a.k.a. ISO 8859-1) would work better for Excel. ------------------------- Pekka.Makinen@softqa.fi SoftQA Oy -http://www.softqa.fi/ |
|
![]() |
|
![]() |
|
Or just export directly to Excel.
Michael Sutherland has a very good excel exporter available. http://galactic-solutions.com/GalacticDownloads.htm ------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
.
Edited: 21-Aug-2008 at 10:12 by chaithali punchatar |
|
![]() |
|
![]() |
|
Also consider using tabs instead of commas, I have had good luck with this method.
|
|
![]() |
|
![]() |
|
If you use tabs or commas, be sure to strip said characters out of the text going into the file. Otherwise you risk screwing up your file.
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
Could you please clarify the 'said' characters you are referring to?
If you use tabs or commas, be sure to strip said characters out of the text going into the file. Otherwise you risk screwing up your file. |
|
![]() |
|
![]() |
|
David is referring to tabs or commas.
For instance, say you want to export the object ID and the requirement statement like so: ID-1, This shall be a requirement. ID-2, This shall be another requirement. What if you have this as a requirement: If the user clicks the button, the button be grey. That comma will mess up your export. So you have to export it like so: ID-3, "If the user clicks the button, the button shall be grey." Otherwise, CSV will think you have multiple columns. ------------------------- Kevin Murphy http://www.baselinesinc.com |
|
![]() |
|
![]() |
|
Likewise if the text contains a double-quote, it needs to be turned into two double-quotes. Its a real drag.
"If the user clicks the ""button"", the ""button"" shall be grey." - Louie |
|
![]() |
|
![]() |
|
The best method I have found to address the CSV stuff is as follows:
1. Replace all double quotes in the string to be exported with single quotes 2. Enclose the string to be written to the file with double quotes. (doing this ensures that excel will treat any commas in the string as part of the literal string) For example: ID-1,This is a "requirement" that has quotes, and a comma in it The output of the above line should look like this in the CSV file "ID-1","This is a 'requirement' that has quotes, and a comman in it" This has worked very well for my applications. |
|
![]() |
|
![]() |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Stream to Excel
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.