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: Importing csv data
Topic Summary:
Created On: 1-Mar-2005 10:26
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.
Answer This question was answered by ron lewis, on Friday, March 11, 2005 4:50 PM

Answer:
you don't have to do a character by character parse --
Most common approach is to use regular expressions -- a sample on how to parse a string with regular expression is in the dxl help file.

 1-Mar-2005 10:26
User is offline View Users Profile Print this message


Ross Marshall

Posts: 7
Joined: 1-Feb-2005

Does anyone have a simple example of a csv import function?
Report this to a Moderator Report this to a Moderator
 1-Mar-2005 12:59
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Your question is so vague you are leaving everyone guessing what you want.
Report this to a Moderator Report this to a Moderator
 1-Mar-2005 15:23
User is offline View Users Profile Print this message


Ross Marshall

Posts: 7
Joined: 1-Feb-2005

I am looking for a dxl function to read csv data. I have a csv data file  (e.g.  x, y, z) and would like to read/import this data so that I have it available in dxl land. I was hoping that there would be a very simple way of doing this, but maybe not.

I hope this is not too vague.  If so, please give me some tips on where I should elaborate.
Report this to a Moderator Report this to a Moderator
 1-Mar-2005 15:28
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Why not use the one shrinkwrapped with doors.

In the Formal Module GUI toolbar go to File->Import Spreadsheet.
Report this to a Moderator Report this to a Moderator
 1-Mar-2005 15:36
User is offline View Users Profile Print this message


Ross Marshall

Posts: 7
Joined: 1-Feb-2005

Because I don't want to import the data into a Doors module.  I want to have it available in dxl.  For example, the data could be a module name that I could use to open a module.
Report this to a Moderator Report this to a Moderator
 1-Mar-2005 15:51
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Here is about as simple as you can get -- you will still have to parse the info out per your favorite method of pasing the data

////////////////simple import of file
string s = readFile("c:/Test.csv")

print s

Report this to a Moderator Report this to a Moderator
 1-Mar-2005 15:57
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

You could also take a copy of the standard CSV importer and modify it for your needs. You can browse to the DXL under:

DOORS standard DXL library
-> Various utilities for importing data into DOORS
--> Import comma or tab-separated spreadsheet and database data
Report this to a Moderator Report this to a Moderator
 1-Mar-2005 16:22
User is offline View Users Profile Print this message


Ross Marshall

Posts: 7
Joined: 1-Feb-2005

Antonio - I was hoping somebody had already modified the standard CSV importer, hence saving me the work of sifting through 19 pages of code.

Ron - That's a little bit too simple!  Are you suggesting that the only way to import csv data is to read the file as one long string and then separate that string character by character?  I was hoping there would be an easier way of doing it than that.
Report this to a Moderator Report this to a Moderator
 1-Mar-2005 16:32
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Answer Answer
you don't have to do a character by character parse --
Most common approach is to use regular expressions -- a sample on how to parse a string with regular expression is in the dxl help file.

Report this to a Moderator Report this to a Moderator
 1-Mar-2005 17:20
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

Until someone pipes up with a modified version of the standard importer, here's something to get you started.

I can think of loads of problems with it, but gives you the gist of using regular expressions to parse a file.
Report this to a Moderator Report this to a Moderator
 2-Mar-2005 08:56
User is offline View Users Profile Print this message


Ross Marshall

Posts: 7
Joined: 1-Feb-2005

Thanks for that Antonio.  That's exactly what I was looking for.
Report this to a Moderator Report this to a Moderator
 2-Feb-2007 15:01
User is offline View Users Profile Print this message


Phil Allen

Posts: 3
Joined: 26-Oct-2006

As an extension to this discussion: I have csv data that has been updated from DOORS data. Do you know a way to use dxl restore the data to DOORS and retain previoius (or new) Object Level? I guess this will mean some clever "create object after/create object below " commands. I have looked at the comma.dxl script but failed to totally understand. I'm a systems engineer not software. Regards Phil Allen
Report this to a Moderator Report this to a Moderator
 5-Feb-2007 09:48
User is offline View Users Profile Print this message


Robert Swan

Posts: 86
Joined: 14-Apr-2005

Reply to phil Search the forums for 'Spreadsheet Import with Hierarchy', that will give some useful pointers.
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.