Searching File

Hi all
Help me to search a File from a given directory.

Hi all
Help me to search a File from a given directory.I think you need to be a little more explicit. Also, I hope that your concept of 'help' is not 'post me the code'.

Similar Messages

  • How to search file in application server using pattern

    Hi all,
    I want to search file in application server.
    Suppose there is file named abc20090808.dat.
    Is there is any function module to search the file?
    it should return back the file names starting with abc, if the import parameter is abc*
    Regards,
    Nikhil

    hello,
                 Have a look
            You can use this function module /SAPDMC/LSM_F4_SERVER_FILE for F4 help for application server file and then you can use the function module TEXT_CONVERT_XLS_TO_SAP to read data into internal table.
      access file from application server
    regards,
    shweta

  • In iTunes 10, I could type "Sinatra" in the search file, and would get a list of all tracks with "Sinatra" in any field.   In iTunes 11 I get these clever little windows, with nice arrows, but no lists to view.   What am I missing?

    In iTunes 10, I could type "Sinatra" in the search file, and would get a list of all tracks with "Sinatra" in any field.   In iTunes 11 I get these clever little windows, with nice arrows, but no lists to view.   What am I missing?

    Thanks for chipping in.   I discovered something after trying what you suggested.   I have quite a few collections of hits by year from Time Life and Billboard.  I've eliminated duplicate tracks that appear in both collections (or other CDs for that matter), but cross-reference the CD where I deleted the track and placed in in the comments section of the CD track I retained.   If I "search" by song name, only the remaining track appears.   But if I want to hear for example Classic Rock 1964, only those tracks remaining would be there when I pull up that CD.   So, I type "Classic Rock 1964,"  in the search field.  First the boxes on the right of the screen open up showing album icons.  Showing four tracks by album with a button to view 10 more, then four songs with an option to vies 18 more.   I finally noticed that at the top of the boxes is a blue band that reads, :Show Classic Rock 1964 in Music.  When I double click on this blue band, all 24 tracks from the original CD appear in the song list format even though I had deleted two of them because they appeard in a Beach Boys CD.   On those tracks, I had referenced Classic Rock 1964 in the comments field.    So, bottom line, Search will also look in the comments field if you click "filter by all" in the magnifying glass to the left of the search field.   And you can move all tracks that if finds into a song list by double clicking on the blue band.

  • Unix Command to search file

    Hi
    Can anyone tell me how to get filename from server using
    UNIX command in ABAP program.I have requirement to search file in server using date criteria.
    should i use 'FIND' command to search file??
    Plz do needful..

    You need to use SM69 to define command and use it in your report.
    Regards,
    Christophe

  • Cannot search file content on Word document with embedded Excel table

    Cannot search file content on Word document with embedded Excel table. I have Windows 8.1 64-bit and Office 2010 Professional. Only phrases from within Excel tables are not searchable. I have many Word documents with embedded Excel table.
    I use it for my invoices. Those invoices are converted to pdf to be sent via mail. Searching the same phrases in related pdf files Works fine. And yes, folders are indexed, searching service is active......... For example I can find all invoices that have
    specific address or name, which is located in word document, but cannot find invoices with specific item name or price, being that information is in embedded Excel table. (not linked, embedded). I thought that is a question for Windows forum, but guys directed
    me here on Office forum. To clarify, I do not use Ctrl+F inside some document, but Windows Search in my folders. Probably the same happens in Office 2013.
    Thank you.

    Hi, I have a lot of Word documents (invoices, offers). Main part of those documents is embedded Excel file because it is easier to do mathematics in Excel than in Word. There are columns with description, unit price, quantity, taxes... Now, I need
    to find who bought HP switch 2530-24G last year. I open folder with last year invoices and search "2530". Cannot find any. But if that document was converted to pdf for mail, than I can find that phrase. Windows search does not work for content if the content
    is in embedded file.

  • Problem with Searching file and writing

    Hi guys,
    i m writing a program to search for a file and if the file exists it will write .
    otherwise printing astatement saying file not found.
    i m passing directory name as an argument.
    in tht there are many ip files.
    the program will search for a particular file in all the zip files.
    i m passing arguments are
    <directory-name> <search-file-name>
    the code is finding the particular file but its not writing to another file.
    i m getting exception as Filenot found.. the code as follows:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Enumeration;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipFile;
    import java.io.*;
    public class SearchFile {
    public static void main(String args[]) {      
         try{
         Testme(args[0],args[1]);
         catch(Exception e){System.out.println(e);}
    public static void Testme(String lists,String sfile)
         File dir = new File(lists);
    File[] children = dir.listFiles();
         int length =children.length;
    if (length < 0) {
    System.out.println("sorry No files found");
    } else {
    for (int i=0; i<length; i++) {
    // Get filename of file or directory
    File fl=children;
              System.out.println("the File name is "+fl.getName());
                        if(fl.getName().endsWith(".zip"))
                   //System.out.println("The zipped files are"+filename);
                   SearchZip(fl,sfile);
    public static void SearchZip(File zipfile,String searchfile)
              //System.out.println("welcome"+zipfile);
              boolean state=false;
    try {
         int count=0;
              ZipFile zf = new ZipFile(zipfile);
              System.out.println("----------------------------");
              System.out.println("Searching in "+zipfile);
              Enumeration entries = zf.entries();
              //System.out.println("the passed file File name is "+args[1]);
              while (entries.hasMoreElements()) {
              ZipEntry ze = (ZipEntry) entries.nextElement();
              System.out.println("----------------------------");
              System.out.println("Listing FIles " + ze.getName() );
              String files=ze.getName();
              System.out.println("----------------------------");
              File f = new File("geetha.txt");
              byte[] buf = new byte[8184];
              String inputLine = "y";
              if (inputLine.equalsIgnoreCase("y")) {
                   long size = ze.getSize();
                   if (size > 0) {
                        System.out.println("name is " files "size is"+ size);
                        BufferedReader br = new BufferedReader(
                             new InputStreamReader(zf.getInputStream(ze)));
                        String line;
                        if(files.equals(searchfile))
                             System.out.println("File Found...............");
                             FileInputStream in = new FileInputStream(files);
                             FileOutputStream out = new FileOutputStream(f);
                             int len;
                        while ((len = in.read(buf)) > 0) {
                             state=true;
                        out.write(buf, 0, len);
                        System.out.println("successfully Written the file");
                        System.out.println("The File Found is "+state);
              catch (Exception e) {
              System.out.println("File Not Found Please check the File"+e);

    This is a multipost of http://forum.java.sun.com/thread.jspa?threadID=692507&tstart=0
    Please return to that thread Santhosh as you have been given a couple of answers already in that thread.

  • Search file within a directory

    hi there... i need to search for a file in a directory. but when i execute it, instead of just typing news.txt i need to type C:/news.txt why is that so when i already concat it.. here is the code and thank you in advance.
    public static void main(String[] args) throws IOException{
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         System.out.println("Enter file to search : ");
    File filename = new File(in.readLine());
    if (filename.exists()){
         String b = ("C:/").concat(filename.getName());
    System.out.println("File name : " + b + " " +"found");
    else{
    Sender sm = new Sender();
              sm.doSend();
    }

    my problem is that when i run the program...i have to type C:/news.txt to search for the file...but this is not i want it to be i want to search by just typing news.txt..understand?? thank you

  • [HELP] Search Files Function

    Hi,
    Could someone please help me fix this function below. It's suppost to search files in a dir for a particular string. I have files in the "./" dir but the function does not seem to output nothing at all.
    The search is also suppost to ignore the filez ending with .zip, .rar ect...
    public static void searchFiles(String s)
            File file = new File("./");
            String as[] = file.list();
            long l = 0L;
              label0:
            for(int i = 0; i < as.length;)
                if(as.endsWith(".zip") || as[i].endsWith(".rar") || as[i].endsWith(".gz") || as[i].endsWith(".jar") || as[i].endsWith(".7z"))
    continue;
    try
    long l1 = 0L;
    BufferedReader bufferedreader = new BufferedReader(new FileReader(as[i]));
    Object obj = null;
    do
    String s1;
    do
    if((s1 = bufferedreader.readLine()) == null)
    continue label0;
    l1++;
    } while(!s1.contains(s));
    l++;
    System.out.println((new StringBuilder()).append(" [").append(l).append("] ").append(as[i]).append(" (Line ").append(l1).append(") ").toString());
    System.out.println((new StringBuilder()).append(" ").append(s1).append(" ").toString());
    System.out.println("");
    } while(true);
    catch(IOException ioexception)
    System.out.println("Critical error while opening file for search!");
    ioexception.printStackTrace();
    i++;
    System.out.println("");
    System.out.println("");
    System.out.println((new StringBuilder()).append(" ").append(l).append(" results for ").append(s).append(".").toString());
    }Edited by: user13462345 on 12-Dec-2010 11:31                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    for(int i = 0; i < as.length;)This is an infinite loop, when as.length > 0
    If there is a file and this file doesn't require
    if(as.endsWith(".zip") || as[i].endsWith(".rar") || as[i].endsWith(".gz") || as[i].endsWith(".jar") || as[i].endsWith(".7z"))
    there will be no output.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Ultra Search / File system

    Hi again,
    I'm developing a document management application and now i'm storing files on the local file system with an structure of folders and subfolders created by me. Now, I want to add functionality of searching documents by content and so, I thought in using Ultra Search. My doubt is what shall I do because I don't want to store files in the database because i would mean to redefine the lowest layer of my application and, obviously, I can't. So, my answer is: Is there a way of having a "pointer" to each file in order to return this identifier every time that I do a search of files containing a certain word? The pointer could be a foreign key to another table with information of how to locate the file.
    I hope it would be clear! :)
    Thanks a lot,
    Jordi
    Thank you very much!

    Jordi
    Now, I want to add functionality of searching
    documents by content and so, I thought in using Ultra
    Search. My doubt is what shall I do because I don't
    want to store files in the database because i would
    mean to redefine the lowest layer of my application
    and, obviously, I can't.With Ultra Search you can directly index and search files stored on the file system. I.e. you don't need to have them in the database.
    HTH
    Chris

  • How to search files by wildcard expression

    how to search files by wildcard expression,
    and list all of them?
    for example:
    search file as image*.jpg or ima231*.jpg.
    please give me some code to study.
    thanks in advance.

    following code is a filename filter that support '*' and '?', hope it helps.
    import java.util.*;
    class MyFilenameFilter {
      static public void main(String args[]){
        byte[] in2=new byte[255];
        String filter=null,fileName=null;
        try{
          while(1>0){
            System.out.print("filter (ex: abc*def?.do?):");
            in2=new byte[255];
            System.in.read(in2);
            if((new String(in2)).trim().length()>0) filter=(new String(in2)).trim();  
            System.out.print("filename (ex: abcerdefi.doc):");
            in2=new byte[255];
            System.in.read(in2);
            if((new String(in2)).trim().length()>0) fileName=(new String(in2)).trim();
            System.out.println("filter="+filter+",filename="+fileName+",result="+(chkfn(filter,fileName)? "Matched":"Not Matched"));
        } catch(Exception e){
             e.printStackTrace();
      static boolean chkfn(String chk,String fn)  {//ex:chk=*fg?gh fn=tdiekd.exe, or ex:chk=test.csv fn=k.csv
        boolean rtn=false;
        int x3=0,x4=0,x4Head=0,x4Tail=0;
        if(chk.endsWith(".*") && fn.indexOf(".")==-1) chk=chk.substring(0,chk.length()-2);
        if(chk.endsWith(".") && fn.indexOf(".")==-1) chk=chk.substring(0,chk.length()-1);
        if(fn==null || fn.length()<1) return false;
        if(chk==null) return true;
        if(chk.length()<1 || chk.equals("*") || chk.equals(".") || chk.equals("*.*")) return true;
        int chkLength=chk.length();
        int fnLength=fn.length();
        int newx4Head=-1,newx4Tail=-1;
        int last_asterisk=chk.lastIndexOf("*");
        int first_asterisk=chk.indexOf("*");
        int asteriskCount=0,aindex[]=new int[20],tmp[]=null,index1=-1,cCount=0;
        String cString[]=new String[20];
        chk=chk.toUpperCase();
        fn=fn.toUpperCase();
        char c='0';
        boolean found=false;
        String chkString="";
        //replace each '**' with '*' befroe further action
        while(chk.indexOf("**")!=-1){
          chk=replace(chk,"**","*");
        chkLength=chk.length();
        last_asterisk=chk.lastIndexOf("*");
        first_asterisk=chk.indexOf("*");
        //count the '*' count
        x3=0;
        while(x3<chkLength){
          if(chk.charAt(x3)=='*'){aindex[asteriskCount]=x3; asteriskCount++;}
          x3++;
        //to get the cString[], each string next to '*'
        StringTokenizer st=new StringTokenizer(chk,"*");
        while(st.hasMoreElements()){
          cString[cCount]=st.nextToken(); cCount++;
        //first check the head and the tail
        if(first_asterisk>0){//first_asterisk!=-1 && first_asterisk!=0
           chkString=chk.substring(0,first_asterisk);
           if(chkString.indexOf("?")!=-1){
                 if(fnLength>first_asterisk-1){
                   if(cmp(chkString,fn.substring(0,first_asterisk))==false) return false;
                 } else return false;
           } else if(!fn.startsWith(chkString)) return false;
           x4Head=chkString.length()+1;
        } else if(first_asterisk==0) {
             x4Head=findMatch(cString[0],fn);
             if(x4Head==-1) return false;
        if(last_asterisk!=chkLength-1 && last_asterisk!=-1){
           chkString=chk.substring(last_asterisk+1,chkLength);
           if(chkString.indexOf("?")!=-1){
                 if(fnLength-(chkLength-last_asterisk)+1>-1){
                   if(cmp(chkString,fn.substring(fnLength-(chkLength-last_asterisk)+1,fnLength))==false) return false;
                 } else return false;
           } else if(!fn.endsWith(chkString)) return false;
           x4Tail=fnLength-chkString.length();
        } else if(last_asterisk==chkLength-1) {
             newx4Tail=findMatch(cString[cCount-1],fn.substring(x4Head));
             x4Tail=x4Head+newx4Tail+cString[cCount-1].length();
        if(asteriskCount>1){
          int oldx4Head=x4Head;
          if(last_asterisk!=chkLength-1) {
               if(cString[cCount-2].indexOf("?")==-1){
              x4Tail=fn.substring(x4Head,x4Tail).lastIndexOf(cString[cCount-2]);
              if(x4Tail!=-1) x4Tail=x4Tail+cString[cCount-2].length();
          if(first_asterisk!=0){
            if(cString[1].indexOf("?")==-1){
              x4Head=fn.substring(x4Head).indexOf(cString[1]);
              if(x4Head!=-1) x4Head=oldx4Head+x4Head;
          //before of this, x4head and x4tail are adjusted according to '*', and now it will also adjusted according to '?'
          if(x4Head>-1 && x4Tail>x4Head &&
             chk.substring(aindex[0]+1,aindex[asteriskCount-1]).indexOf("*")==-1 &&
             chk.substring(aindex[0]+1,aindex[asteriskCount-1]).length()!=x4Tail-x4Head &&
             chk.substring(aindex[0]+1,aindex[asteriskCount-1]).indexOf("?")!=-1){
               newx4Head=-1;
               newx4Head=findMatch(chk.substring(aindex[0]+1,aindex[asteriskCount-1]),fn.substring(x4Head,x4Tail));
               if(newx4Head>-1) {
                 x4Head=x4Head+newx4Head;
                 x4Tail=x4Head+aindex[asteriskCount-1]-(aindex[0]+1);
          if(x4Head>-1 && x4Tail>x4Head) return chkfn(chk.substring(aindex[0]+1,aindex[asteriskCount-1]),fn.substring(x4Head,x4Tail));
          else return false;
        } else if(asteriskCount==0){
              if(fnLength==chkLength) return cmp(chk,fn);
                else return false;
        return true;
      static public boolean cmp(String chkString,String fnString){//1.no '*', 2.only for two strings having same length 3.two  strings are uppercase before call this method
        boolean rtn=false;
        int clength=chkString.length(),flength=fnString.length();
        if(clength!=flength) return false;
        for(int i=0;i<clength;i++){
          if(chkString.charAt(i)!='?' && chkString.charAt(i)!=fnString.charAt(i)) return false;
        return true;
      static public int findMatch(String chkString,String fnString){//to find out the correct index postion for the string between two '*'
        int rtn=-1;
        boolean found=false;
        int chkLength=chkString.length();
        int fnLength=fnString.length();
        if(chkLength>fnLength) return -1;
        for(int i=0;i<fnLength-chkLength+1;i++){
          found=true;
          for(int j=0;j<chkLength;j++){
            if(chkString.charAt(j)!='?' && chkString.charAt(j)!=fnString.charAt(j+i)) {found=false; break;}
          if(found) return i;
        return rtn;
      public static String replace(String s, String s1, String s2) {
          if(s!=null && s1!=null && s2!=null){
            int i = 0;
            int j = s.length();
            int k = s1.length();
            int l = s2.length();
            do {
                String s3 = "";
                i = s.indexOf(s1, i);
                if(i == -1)
                    break;
                StringBuffer stringbuffer = new StringBuffer(s.substring(0, i));
                s3 = s.substring(i + k);
                stringbuffer.append(s2).append(s3);
                s = stringbuffer.toString();
                j = s.length();
                i += l;
            } while(i <= j);
          return s;
    }

  • How to search files on a windows configured external hard disk on macbook air

    I am trying to search files on my passport Ultra Western Digital, which is configured for windows and has read only permissions for my macbook air, i am unable to instant search results through finder or spotlight. Is there a way to search them?

    Well, to clarify:
    I want to find all user text files and mail messages on a Time Machine backup disk that contain the word "escalator".
    By user files I mean those in
    /Volumes/Time Machine Backups/Backups.backupdb/<username>iMac/*/Macintosh HD/Users
    and subdirectories thereof.
    I was trying to use the find command, but it was taking a very long time, so I aborted it. I then realized that most of the files have many hard links, and therefore will be searched many times. That, of course, is a great waste.
    Is there some way to search each file only once?
    Thanks.

  • No search files field

    here is no search files field when i open a PDF and when i insert from file. I have gotten a different PC at work with same standard addition and my old pC had the search field?  I have run the repair and tried to look this issue up.  contacted Adobe and they said that the only way to get help  is this way.  Thank you to anyone that can help.
    I have version x standard 10.1.11
    Can someone help me fix this as I am in and out of adobe all day and need to be able to search instead of having to scan through tens of thousands of docs to find the one i need.  Thanks

    With X and XI  it is not shown "by design" so -- access via Ctrl+F.
    Be well...

  • Can not search files on OSX 10.7.5

    My users, running 10.5, can not search files stored on my new server that is running 10.7.5 Lion. Some times they can but most of the time they can not. I cant find where to turn on indexing to see if that is the problem.
    Thanks
    Dave

    Indexing says its disabled. How do I turn it on?
    I have tried
    sudo mdutil -a -i on
    It still says disabled.

  • Utility that can search files on hard disk

    I want to implement a utility in my application that can search files on the hard disk just like "find files and folsers" option in start menu of windows. What algorithm/techniques and java classes I should use.

    What algorithm/techniques and java classes I should use.
    You'll need to use recursion and the JDK 1.4.x regular expression package, java.util.regex, for pattern matching. A Java Developer's Journal article located at http://www.sys-con.com/java/article.cfm?id=854 details an implementation of a Java file search utility. Be aware that the article was written three years ago and uses a thrid-party regular expression package but it can certainly guide you in the right direction.

  • Firefox creates a 'search' file on my desktop everytime I search (press enter). How do I stop this?

    Firefox creates a 'search' file on my desktop everytime I search (press enter). How do I stop this?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    See also [[/questions/921535]]

  • Windows XP Search Files Folders won't find java

    Hi everyone,
    I am running Java 1.4.0 (beta 3) on my Windows XP machine. Today I discovered that when I try searching files and folders for files with an extension .java it finds them, but then when I enter in a string to search for (i.e., "import", or "package"), the search ALWAYS FAILS.
    Funny, but when I rename some of the .java files with a .txt extension, then I get hits.
    I tried searching for the string "xmlns" in files with a .xml extension, and that works fine.
    I tried adding a file type of Java, but that didn't help.
    So how do I get Windows XP to search through Java files? I had no problem with this in Windows 2000. This almost sounds deliberate.

    I may have found an answer, and will post a link here:
    http://www.lesession.demon.co.uk/abc/Search_abc_XP.htm
    My adding a file type wasn't enough, I somehow have to tell my machine that .java is a plain text type.
    I will try it at work tomorrow.

Maybe you are looking for

  • Multiple .Mac accounts, on one Admin account on one computer

    Hello all, I am trying to have multiple .Mac accounts to publish independent iWeb websites on unique domains (the apple iweb provided ones) but it appears I can only have one .Mac account on my computer's network user to do the easy one click Publish

  • Question on the function okFindIndex

    Hello all, I have some questions on programming palm application by using Olite502 and codewarrior. In the palm database, there is a table call PDA_CASE, I that table, there are 4 fields, i.e. CASE_NO, ID, TEL, ADDRESS. Now, in my application, i have

  • Problem in navigating tabs

    Hi I have one form with 2 tabs tab1 tab2      tab1 is having some text boxes, checkboxes and list box. (Master form)      tab2 is having some text boxes in tabular form and some list boxes (Details form) ...Whatever I enter in this tab i am saving ba

  • Can Apple TV downstream HD content?

    I used to enjoy my Apple TV with a 40GB hard drive until it stopped working.  I could play HD content and the sound was great.  Can the new Apple TV do the same?  I bought one and I don't think it plays HD content, even when it says the content is in

  • SAP Business Connector 4.8 and Webmethods EDI Package WmEDI

    Hello, we want to upgrade our SAP Business Connector to 4.8 and need to install the EDI package provided by Webmethods earlier. We now figured out, that the EDI package is not provided anymore for download in the SAP Service Marketplace. Any idea, ho