forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


List filtering...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
ColdWind
Newbie


Joined: 18 Apr 2001
Posts: 12
Location: UK

PostPosted: Mon Jan 14, 2002 4:00 pm    Post subject: List filtering... Reply with quote

Hi, i have a list that displays all the files in a directory, but how can i make it is that if the extention is not say *.txt dont add to list?

Thank you...

_________________
My site @ http://ix.d2g.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Jan 14, 2002 4:03 pm    Post subject: Reply with quote

ColdWind,
You could load the list with all the files then search through the list and remove all files that have the *.txt extensions from the list.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Jan 14, 2002 4:10 pm    Post subject: Reply with quote

ColdWind,
You can also use wildcards with LIST FILELIST in the filespecs section. Here is the info from the VDS help file of VDS 3.x....

FILELIST is used to add to the list <list> the names of files that match a particular specification, which may include wildcards. Note that whether just the name and extension or the full path is returned depends on whether a full path is given in <filespec>. The file specification may optionally be followed by a list of attributes which will be used to filter the list of files selected. The attributes may be specified as: A - archive; D - directory; H - hidden; R - read only; S - system; V - volume label. The attributes are additive, so if you specify HS for example the list will contain files that have the hidden attribute, the system attribute or both..

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ColdWind
Newbie


Joined: 18 Apr 2001
Posts: 12
Location: UK

PostPosted: Mon Jan 14, 2002 4:10 pm    Post subject: Reply with quote

Im only a begginer still finding my way around the program.

How would i search a list?

Thank you.

_________________
My site @ http://ix.d2g.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Jan 14, 2002 4:15 pm    Post subject: Reply with quote

Hi, Coldwind!

You could do something like this:
Code:
list create,1
list filelist,1,*.*
repeat
if @match(1,".txt")
list delete,1
end
until @not(@match(1,".txt"))
list close,1


That will create a list of files in a directory and delete those lines in the list containing .txt

Greetz
Dr. Dread
Back to top
View user's profile Send private message
ColdWind
Newbie


Joined: 18 Apr 2001
Posts: 12
Location: UK

PostPosted: Mon Jan 14, 2002 4:34 pm    Post subject: Reply with quote

How could i make it so the list removes all file apart from *.txt files?

Thank you...

_________________
My site @ http://ix.d2g.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Jan 14, 2002 4:46 pm    Post subject: Reply with quote

Hi ColdWind,
Ok just so I can understand you correctly. Are you saying that you want a filelist with nothing but *.txt files listed or are you saying you want a filelist that excludes *.txt files?

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ColdWind
Newbie


Joined: 18 Apr 2001
Posts: 12
Location: UK

PostPosted: Mon Jan 14, 2002 5:28 pm    Post subject: Reply with quote

yes thats right i need a filelist with only the txt file in it no matter what files are in the dir...
_________________
My site @ http://ix.d2g.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Jan 14, 2002 5:35 pm    Post subject: Reply with quote

Hi ColdWind,
Ok for that then just do this with the List Filelist command...

LIST FILELIST,1,c:\SOMEDIR\*.TXT

This should put only the *.txt files in the file list.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ColdWind
Newbie


Joined: 18 Apr 2001
Posts: 12
Location: UK

PostPosted: Mon Jan 14, 2002 5:40 pm    Post subject: Reply with quote

Thank you much it works perfectly...

Thank you... Smile

_________________
My site @ http://ix.d2g.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group