comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: forward slash in data item name
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: forward slash in data item name [message #52050] Thu, 04 January 2007 09:58
maye is currently offline  maye
Messages: 29
Registered: June 2006
Junior Member
Happy new year!
Thanks, David.
As usual, I'm stunned that you have time to be so responsive here. ;)
Best regards,
Michael

David Fanning wrote:
> maye writes:
>
>> I wonder if there's a way I can avoid the following problem:
>> I create plot file names automatically from the data item name in a
>> first row of a csv file.
>> Unfortunately, one of the data item names has a forward slash in it
>> (DC/DC), which leads to the case, that my routine wants to create a
>> file name: "DC/DC.jpg" which of course is interpreted as a directory
>> creation.
>> Of course I could check every data item name for such a thing to occur
>> and replace every slash with an underscore, but is there not a simpler
>> way to avoid such caveats?
>
> I'm afraid you are going to have to check it. Probably
> the simplest thing is to just replace the "/" with
> something else. Here is an article that describes an
> easy way to do that:
>
> http://www.dfanning.com/code_tips/stringsubs.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: forward slash in data item name [message #52082 is a reply to message #52050] Fri, 29 December 2006 09:10 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maye writes:

> I wonder if there's a way I can avoid the following problem:
> I create plot file names automatically from the data item name in a
> first row of a csv file.
> Unfortunately, one of the data item names has a forward slash in it
> (DC/DC), which leads to the case, that my routine wants to create a
> file name: "DC/DC.jpg" which of course is interpreted as a directory
> creation.
> Of course I could check every data item name for such a thing to occur
> and replace every slash with an underscore, but is there not a simpler
> way to avoid such caveats?

I'm afraid you are going to have to check it. Probably
the simplest thing is to just replace the "/" with
something else. Here is an article that describes an
easy way to do that:

http://www.dfanning.com/code_tips/stringsubs.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Using value_locate with a non-monotonic vector! And it's working!??!
Next Topic: Re: Gram-Schmidt transformation

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:13:07 PDT 2025

Total time taken to generate the page: 0.00634 seconds