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

Home » Public Forums » archive » help with string manipulation
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
help with string manipulation [message #89343] Thu, 21 August 2014 09:14 Go to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Hi all

I have data named like this:

dat(001,001)
dat(001,002)
dat(001,003)
dat(001,004) and so on till a(001,200).

I had import my data like this:

Data = 'c:\path\dat(001,'+strcompress(i)+').csv'

The first part of dat(001,001)is fixed is always 001 but the second part is a string of 3 numbers which have to be created. I want to convert these numbers from 0-200 into a string of 3 numbers. Can anyone knows how to do it?

Many Thanks
Re: help with string manipulation [message #89344 is a reply to message #89343] Thu, 21 August 2014 09:24 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Thu, 21 Aug 2014 09:14:04 -0700 (PDT), g.nacarts@gmail.com wrote:

> Hi all
>
> I have data named like this:
>
> dat(001,001)
> dat(001,002)
> dat(001,003)
> dat(001,004) and so on till a(001,200).
>
> I had import my data like this:
>
> Data = 'c:\path\dat(001,'+strcompress(i)+').csv'
>
> The first part of dat(001,001)is fixed is always 001 but the second part is a string of 3 numbers which have to be created. I want to convert these numbers from 0-200 into a string of 3 numbers. Can anyone knows how to do it?
>
> Many Thanks

Please try:
filename = 'c:\path\dat(001,'+string(i,format='(i3.3)')+').csv'

If you want do go the "IDL way", you can create a string array,
including all 201 names:
filenames =
'c:\path\dat(001,'+string(indgen(201),format='(i3.3)')+').cs v'

HTH, Heinz
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Reading CEOS format using IDL
Next Topic: IDL 8 Graphics without X-WIndows

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

Current Time: Wed Oct 08 15:11:24 PDT 2025

Total time taken to generate the page: 0.00402 seconds