Jump to content

file SOP naming problem


daland

Recommended Posts

Hi all,

I am writing a little script that reads in a bunch of bgeos in file SOPs (and then does some other stuff)... I want the name of the file SOP to be the name of the .bgeo. using s foreach and everything works fine except for

the naming of the file SOP

The problem is that SOPs don't like to have those pesky periods in the name like " file.bgeo"

in UNIX I can strip off the extenion using :r

set name = file.bgeo

set stripname = $name:r

I am looking for a way to do this in the textport...

any ideas?

thanks,

david

Link to comment
Share on other sites

thanks danteA!

your suggestion works except when I use a variable like $fname..

If I use test.bgeo in place of $fname it works...I think it is maybe a

syntax problem ...have tried using quotes, ticks, single quotes but can't

quite get the right combination....

any ideas?

basically this is how I am using it.

-------------------------------------

foreach J ( `system("ls /bgeo")`)

echo $J

set geoname = `substr($j,0,rindex($j,"."))`

echo $geoname

---------------------------------------

thanks,

david

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...