| View previous topic :: View next topic |
| Author |
Message |
gerrit Newbie

Joined: 14 May 2004 Posts: 24
|
Posted: Fri Oct 01, 2004 5:58 pm Post subject: Filelist only root Dir without Path ? |
|
|
This problem makes me really Crazy, and I can't find a propper Solution for it...
May one of the Crack's knew something...
I'm shure I missed a simple Command again...
I wrote a Programm witsh uses Dir's as Article Nr.
Right now I'm using a bat file to get the Dirlisting into a file, but It's not really a solution.
Dir *. /b > x.txt
Now I tried it with.....
| Code: |
%%WebPD = SomePath
List filelist,Dirlist,%%WebPD*.,*
|
... witsh is'nt really clear to me why first *. and then * for all sub dir's. It does'nt do the sub dir's what I want, but there is still the Path included.
Okay work's... whatever, but I want to remove the Path itself, so that I only get the Article Nr. (..just the Dir Name without Path and drive info)
What works fine is....
| Code: |
%%WebPD = SomePath
List filelist,Dirlist,@Name(%%WebPD*.),*
|
... but only in the dir where my prog is placed.
So I expected that this should Work....
| Code: |
%%WebPD = SomePath
List filelist,Dirlist,%%WebPD@Name(*.),*
|
.... but it's again with the Path.
Okay what I could do is to remove the Path with the String.dll.... but...
Is'nt there something like ...
May someone has a better solution than the funky Batsh file.....
Thanks...  _________________ ___________________
Gerrit Corsmeyer
Gerrit@corsmeyer.de
www.corsmeyer.de
___________________ |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Oct 01, 2004 11:16 pm Post subject: |
|
|
To get a listing of a particular directory and its sub dirs:
| Code: |
list create,1
list filelist,1,c:\*.*,*D
|
Then to get the name portion of the listing, scan each item in the list
using the @name() function on each list item. You can then either add the
@name() results to another string list and save it to a file, or you can use
'List put,1,@name(@item(1))' to replace each items full path with just its
name., then save the file to disk.
Hope this helps, _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Fri Oct 01, 2004 11:46 pm Post subject: |
|
|
See if this little script does what ya want:
| Code: |
%%fileSpec = c:\*.*
%%saveAsFile = c:\dirNames.txt
list create,1
list filelist,1,c:\*.*,*D
if @greater(@count(1),0)
%x = 0
repeat
%I = @item(1,%x)
if @not(@null(%I))
list put,1,@name(%I)
end
%x = @succ(%x)
until @equal(%x,@count(1))
end
list sort,1
dialog create,Get Folder Names,-1,0,200,300
dialog add,LIST,L1,5,5,190,290
dialog show
list assign,L1,1
rem Uncomment the following to save the file
rem list savefile,1,%%saveAsFile
list close,1
:Evloop
wait event
goto @event()
:CLOSE
exit
|
Does this help? _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
gerrit Newbie

Joined: 14 May 2004 Posts: 24
|
Posted: Sat Oct 02, 2004 12:14 am Post subject: |
|
|
Yeep Thank's...
Was the Parameter ,*D what I missed in the Filelist.
Good Idea to switsh the UI Off..
merci..
G. _________________ ___________________
Gerrit Corsmeyer
Gerrit@corsmeyer.de
www.corsmeyer.de
___________________ |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|