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: replace spaces with comma in a string
Topic Summary:
Created On: 16-Nov-2005 21:02
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 Tony Goodman, on Thursday, November 17, 2005 2:47 PM

Answer:
The attached should do the job for you.
This function allows you to specify the character to be replaced and the character to replace it with.
 16-Nov-2005 21:02
User is offline View Users Profile Print this message


Thanh Lam

Posts: 17
Joined: 3-Feb-2005

I need DXL code that replace any space with comma in a string.
Example: 12345 34567 54321 67894 change to 12345,34567,54321,67894

Thanks so much!
Report this to a Moderator Report this to a Moderator
 17-Nov-2005 09:38
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Answer Answer
The attached should do the job for you.
This function allows you to specify the character to be replaced and the character to replace it with.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 23-Jul-2006 12:12
User is offline View Users Profile Print this message


Paulo Cheong

Posts: 1
Joined: 12-Oct-2005

hi everyone,

I wonder if you would have any brilliant idea on my problem.

I was trying to import an excel spreadsheet into DOORS.  Some of the cells include line breaks which mess up the import process(DOORS will read each line break as the end of an object; in the other words, if one cell includes 10 line breaks, DOORS will read it as 10 objects instead of one)

As a result, I did a replace in Excel(MS word actually), to replace the link breaks into "#".  Now I have problem turning these #'s back to link breaks.  I cannot use the DOORS replace function, nor the script above, as "^l" is not one character

if you have a clue, please give me a kind yell!

Cheers,
Paulo

Report this to a Moderator Report this to a Moderator
 24-Jul-2006 07:32
User is offline View Users Profile Print this message


Michael Werner

Posts: 15
Joined: 29-May-2006

Hi,

what is ^l? try '\n'. You have to use ' ' instead of " ", because " " indicates a string, while ' ' indicates a char.


print subStr("abc#def#ghi", '#', '\n')


regards michael

Edited: 27-Jul-2006 at 11:15 by Michael Werner
Report this to a Moderator Report this to a Moderator
 26-Jul-2006 22:33
User is offline View Users Profile Print this message


Baher Mohamed

Posts: 63
Joined: 21-Jun-2005

quote:

Originally posted by: Paulo Cheong
hi everyone,</P>


I wonder if you would have any brilliant idea on my problem.

I was trying to import an excel spreadsheet into DOORS. Some of the cells include line breaks which mess up the import process(DOORS will read each line break as the end of an object; in the other words, if one cell includes 10 line breaks, DOORS will read it as 10 objects instead of one)

As a result, I did a replace in Excel(MS word actually), to replace the link breaks into "#". Now I have problem turning these #'s back to link breaks. I cannot use the DOORS replace function, nor the script above, as "^l" is not one character

if you have a clue, please give me a kind yell!

Cheers,
Paulo</P>


are you using DOORS 8.0? if so, i had issues with imports going off the track. my case was the encoding was off...i have to import stuff with it set to Latin I...dont ask me why latin...run this dxl to tell you what encoding your machine is...guess it only applies if you are in DOORS 8.0 actually...i think they fixed it in 8.1.

print currentANSIcodepage

/*
The original error you were getting when the computer freezes because of
the quotes in the csv file is caused by the encoding that is set on your
machine when the document is saved. This same encoding must be set in
the advanced section of the spreadsheet import. To find out what
encoding is on your machine you can use the following DXL: print
currentANSIcodepage.
*/

Edited: 26-Jul-2006 at 22:37 by Baher Mohamed
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.