• Post Reply Bookmark Topic Watch Topic
  • New Topic

Identify text files beginning with 'XSMCE' word

 
Sandeep Swaminathan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to identify text files beginning with 'XSMCE' word. I have filtered text files but am confused with how to identify files. 'XSMCE' is the format of the name of the file and not the content!!
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "filtered text files" - what exactly do you have? If it's a File[], then it should be easy to iterate through it and remove all files that meet certain filename criteria, no?
 
kiran mathew
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a java class implementing the interface java.io.FileFilter. Override the accept() method

boolean accept(File pathname) {
return (pathname.getName().indexOf("XSMCE") > -1);
}

Instances of this may be passed to the listFiles(FileFilter) method of the java.io.File class.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a GUI question?
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope. Moving to I/O.
 
Sandeep Swaminathan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thanks a lot all of you .. Well it was about UI using file concept. It was a block and as Ulf said I iterated it and removed unusual values and identfied files which beginswith the name XSMCE. Thanks again!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!