![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Replacing a string by newline char Topic Summary: Search&Replace Created On: 9-Jun-2005 14:58 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
When I import data from a spreadsheet I have the problem that if there are newlines in a column the Excel CSV export splits these columns and starts the second part in a new line. Directly such a file cannot be imported. Thus, I wrote a filter the replaces such new lines by a " |
|
![]() |
|
![]() |
|
Replacing text withing rich text strings is real tricky since you need to know to avoid the RT markup and only replace the raw text. You could use the "cutRichText" command to build the 3 parts of the new sting, but its indecies need to be based on the relative positions of the corresponding raw (non-RT) strings. Its a mess.
|
|
![]() |
|
![]() |
|
You can replace a special character with a carriage return, but you are right that you have to do it with a DXL script. Here is mine, that replaces an at sign (@) with carriage returns:
// File: at_signs_to_carriage_returns.dxl // Author: Mary Schweizer // Date: January 8, 2004 // // This DXL script converts @ signs to carriage returns // for a specified attribute in every DOORS rows in the // current view. // // To run it: // 1) select Tools->Edit DXL ... // 2) Load this file in the DXL editor that pops up // 3) Click the Run button. Object o Buffer temp_string = create // allocate memory int i for o in current Module do { // *************************************** // Change the attribute name on the line below // to the attribute you want to change // *************************************** temp_string = o."Object Text" "" i = contains(temp_string, '@', 0) while (i > -1) { set (temp_string, i, '\n') i = contains(temp_string, '@', 0) } // *************************************** // Change the attribute name on the line below // to the attribute you want to change // *************************************** o."Object Text" = stringOf(temp_string) } delete temp_string // delete memory allocation ------------------------- Mary Schweizer BAE Systems |
|
![]() |
|
![]() |
|
Hello Mary,
sorry for the late reply. This one helps a lot. Thak you very much. Regards Christian |
|
![]() |
Telelogic DOORS
» General Discussion
»
Replacing a string by newline char
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.