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

Home » Public Forums » archive » spawn
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
spawn [message #89173] Wed, 30 July 2014 10:28 Go to next message
Gompie is currently offline  Gompie
Messages: 76
Registered: August 2012
Member
Hi
Can anyone help me with my spawn comand.
I wish to copy a files iteratively by first storing filenames and path as

f=file_search('*.nc')
and then copy
to
g=/home/mark/matchup/MIRS_AMSU

by using a spawn command in idl.

But I get syntax error.
Any help.
GlanPlon.
Re: spawn [message #89177 is a reply to message #89173] Wed, 30 July 2014 14:45 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 7/30/14, 11:28 am, Gompie wrote:
> Hi
> Can anyone help me with my spawn comand.
> I wish to copy a files iteratively by first storing filenames and path as
>
> f=file_search('*.nc')
> and then copy
> to
> g=/home/mark/matchup/MIRS_AMSU
>
> by using a spawn command in idl.
>
> But I get syntax error.
> Any help.
> GlanPlon.
>

Why are you not using FILE_COPY? It was introduced in IDL 5.6.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: spawn [message #89194 is a reply to message #89177] Thu, 31 July 2014 11:03 Go to previous messageGo to next message
Gompie is currently offline  Gompie
Messages: 76
Registered: August 2012
Member
Hi,
Thanks for letting me know. But again I am not getting the sytax right. For eg

idl> file_copy,'/disk1/Mark/*.nc','/home/mark/test'

gives syntax error.

GlanPlon
Re: spawn [message #89195 is a reply to message #89194] Thu, 31 July 2014 13:14 Go to previous messageGo to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
You cannot use wild cards here and need instead a string array with files names. You can get that using file_search, which does allow wild cards. H

On Thursday, July 31, 2014 2:03:06 PM UTC-4, Gompie wrote:
> Hi,
>
> Thanks for letting me know. But again I am not getting the sytax right. For eg
>
>
>
> idl> file_copy,'/disk1/Mark/*.nc','/home/mark/test'
>
>
>
> gives syntax error.
>
>
>
> GlanPlon
Re: spawn [message #89196 is a reply to message #89173] Fri, 01 August 2014 01:35 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den onsdagen den 30:e juli 2014 kl. 19:28:54 UTC+2 skrev Gompie:
> Hi
>
> Can anyone help me with my spawn comand.
>
> I wish to copy a files iteratively by first storing filenames and path as
>
>
>
> f=file_search('*.nc')
>
> and then copy
>
> to
>
> g=/home/mark/matchup/MIRS_AMSU
>
>
>
> by using a spawn command in idl.
>
>
>
> But I get syntax error.
>
> Any help.
>
> GlanPlon.

You don't tell us the spawn command you tried, so I can't say what causes your syntax error. (Unless you didn't get that far because you really did write the g=/home/mark/matchup/MIRS_AMSU line as above, without quotes.)

Anyway, something like the following should do it (untested):

g='/home/mark/matchup/MIRS_AMSU'
f=file_search('*.nc',count=nfiles)
if nfiles gt 0 then begin
flist = join(f,' ')
spawn, 'mv ' + strjoin(f,' ') + g
end
Re: spawn [message #89197 is a reply to message #89196] Fri, 01 August 2014 01:57 Go to previous message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den fredagen den 1:e augusti 2014 kl. 10:35:57 UTC+2 skrev Mats Löfdahl:
>
> flist = join(f,' ')

Of course, this line is not necessary...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL stop reading file after 200 files
Next Topic: How to make Box-Whisker plot with log-log scale?

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

Current Time: Wed Oct 08 11:39:28 PDT 2025

Total time taken to generate the page: 0.00483 seconds