View previous topic :: View next topic
|
Author |
Message |
venkatatcts
New User
Joined: 16 Mar 2009 Posts: 55 Location: India
|
|
|
|
Hi,
There is a character field of length 50 which has special characters like "string1". I want to add double quotes to it. For example,
New York financial "times" to
New York financial ""times""
New York is "a" city to
New York is ""a"" city
The double quote string is dynamic in the field of length.
Thanks in advance |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Reference modification or redefinition into an array will work. You need your original variable and an output variable; just move character by character from the input to the output variable, checking to see if you have the double quote mark character and if so adding another one to the output variable.
Questions you need to investigate:
- what happens if the copied data is more than 50 bytes with the extra quotes?
- are you limited to only one pair of quotes per line?
- will you always have paired quotes, or can you have just a single one? if a single one is possible, does it get doubled in the output?
And nothing you posted has anything to do with a .csv file, so why did you mention it in your title? |
|
Back to top |
|
|
venkatatcts
New User
Joined: 16 Mar 2009 Posts: 55 Location: India
|
|
|
|
Thanks,
Is there any sample code which I could refer. Thanks |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
This is a forum for experts -- who won't need sample code, especially for such a simple task. Perhaps you should go the Beginner's and Students Forum instead? |
|
Back to top |
|
|
|