Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Stream to Excel
Topic Summary:
Created On: 20-Aug-2008 07:30
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 20-Aug-2008 07:30
User is offline View Users Profile Print this message


Sheela Roy

Posts: 24
Joined: 30-Dec-2007

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?
Report this to a Moderator Report this to a Moderator
 20-Aug-2008 10:49
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

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.
Report this to a Moderator Report this to a Moderator
 20-Aug-2008 11:23
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

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/
Report this to a Moderator Report this to a Moderator
 20-Aug-2008 13:36
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 21-Aug-2008 10:02
User is offline View Users Profile Print this message


chaithali punchatar

Posts: 21
Joined: 22-Apr-2007

.

Edited: 21-Aug-2008 at 10:12 by chaithali punchatar
Report this to a Moderator Report this to a Moderator
 21-Aug-2008 12:48
User is offline View Users Profile Print this message


Farley Reynolds

Posts: 4
Joined: 5-Dec-2006

Also consider using tabs instead of commas, I have had good luck with this method.
Report this to a Moderator Report this to a Moderator
 21-Aug-2008 12:58
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

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
Report this to a Moderator Report this to a Moderator
 15-Sep-2008 21:52
User is offline View Users Profile Print this message


anant mitra

Posts: 50
Joined: 27-Jul-2007

Could you please clarify the 'said' characters you are referring to?

Originally posted by: David Pechacek

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.
Report this to a Moderator Report this to a Moderator
 17-Sep-2008 15:18
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 120
Joined: 16-Jan-2008

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
Report this to a Moderator Report this to a Moderator
 17-Sep-2008 16:24
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
 22-Sep-2008 15:33
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 58
Joined: 17-Oct-2006

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.
Report this to a Moderator Report this to a Moderator
 22-Sep-2008 16:17
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

There is a standard for csv files -- that you may prefer to use.

I detailed the standard Here:
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.