Announcement

Collapse
No announcement yet.

Create a text list of files from a search ?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Create a text list of files from a search ?

    Is there any way to generate a text list from a windows XP file search ?

    Why I need to know :

    You don't need to know this, but it's a blatant appeal to anyone's good nature in the hope someone can help.

    You know how sometimes you don't realise you have a problem until things have been happening for a while ?

    The other day I was helping a customer who was being pursued by a complete bastard of a debt collector. I'm not talking about someone ringing up to remind someone they need to pay a debt - I've got no problem with legitimate collectors and I know some people on the board do that kind of work. This is someone who told my customer that if she didn't pay immediately they were sending someone round to take her good. They can't legally do that, and in this case the debt is completely legally unenforcable because the company they are collecting for broke the law when they lent the money (and failed to make a proper agreement).

    In discussing the case with a colleague I discover that the same supposed legitimate government licensed collection agency has also told 2 other people that they had court orders when they didn't. One unlawful threat can be an accident or a single bad person in a call centre - but this is a pattern. They're deliberately taking on unenforcable debts and then delibreately lying about the legal position.

    They're breaking the guidelines of the licensing authority and I'd like to make a complaint. Enough complaints they could lose their license.

    However the debt worker can't remember who they threatened. So I only have one complaint to go on. If I can identify a small pool of possible customers he'll try and track down his cases so we can use them as part of a multiple complaint.

    Actual computer problem :

    Due to chaos in our computer systems all files over 4 months old show as being created 4 months ago when our server was moved. The only parameter I have is the name of the company concerned. I ran a search through the files where we store letters we've sent on behalf of the customers we work with - searched for any document which contains the name of evil debt collector. But I've ended up with about 200+ documents - the name of the documents doesn't tell me the name of the customer. The name of the file they are in does - and some files have multiple documents in the search. Files could be recent or over 10 years old, I can't tell without opening every single document and hoping no one has used automatic date fields...

    I can see the containing files when I view the details - but I can't select the text or copy and paste. What I really want is to get that list as text so I can remove the duplicates without doing the whole thing by hand.

    Is this possible ?

    I'm searching word documents in XP, the search term is only in the file not always in the file name, and I want a list of files not documents.



    Victoria J
    Last edited by Victoria J; 10-07-2009, 03:26 PM.

  • #2
    If you open the command prompt (start -> run -> type cmd -> enter), go to the folder you want (or just c:\ by typing cd\)

    then type:

    dir/s *.doc > text.txt

    or

    dir/s *.docx > text.txt

    it'll do it for you
    To err is human, to blame someone else shows good management skills.

    my blog --> http://www.hendrices.com/joesblog/
    my brother's blog --> http://www.hendrices.com/ryansblog/

    Comment


    • #3
      You can also use something like this to gain the ability to right-click on a folder name (not sure if it works on a search but there may be a way to implement it) and get a file listing:

      http://www.theeldergeek.com/file_list_generator.htm
      "For a musician, the SNES sound engine is like using Crayola Crayons. Nobuo Uematsu used Crayola Crayons to paint the Sistine Chapel." - Jeremy Jahns (re: "Dancing Mad")
      "The difference between an amateur and a master is that the master has failed way more times." - JoCat
      "Thinking is difficult, therefore let the herd pronounce judgment!" ~ Carl Jung
      "There's burning bridges, and then there's the lake just to fill it with gasoline." - Wiccy, reddit
      "Retail is a cruel master, and could very well be the most educational time of many people's lives, in its own twisted way." - me
      "Love keeps her in the air when she oughta fall down...tell you she's hurtin' 'fore she keens...makes her a home." - Capt. Malcolm Reynolds, "Serenity" (2005)
      Acts of Gord – Read it, Learn it, Love it!
      "Our psychic powers only work if the customer has a mind to read." - me

      Comment


      • #4
        Quoth joe hx View Post
        If you open the command prompt (start -> run -> type cmd -> enter), go to the folder you want (or just c:\ by typing cd\)

        then type:

        dir/s *.doc > text.txt

        or

        dir/s *.docx > text.txt

        it'll do it for you
        I may be being a complete fool but I can't find the files I want. I'm not a complete stranger to the command prompt but I've never used it at work and I'm not used to the multiple drives.

        My command prompt is on drive U which is my home drive, but I need to get to a file in drive S which is shared files and I can't work out how to do it.

        Apologies for being so brainless today.

        Victoria J

        Comment


        • #5
          Quoth EricKei View Post
          You can also use something like this to gain the ability to right-click on a folder name (not sure if it works on a search but there may be a way to implement it) and get a file listing:

          http://www.theeldergeek.com/file_list_generator.htm
          I will try this tomorrow - I've run out of time for meddling today. Tomorrow is another day for doing things that will make our poor computer guy weep...

          I'm not sure that does what I want but it looks like it should be possible to use some variation.

          (I'm still waiting for him to look disapprovingly at the batch file I've got opening all my programs at the start of the day - which is the first I've used).

          If nothing else I'm learning stuff.

          The problem is that as with so much in life I have a kind of insane twisted laziness that would make me rather spend hours learning a good "easy" or at least "efficient" way to do this than just spend the time going through the files and writing them down by hand.

          Thanks,

          Victoria J

          Comment


          • #6
            Quoth Victoria J View Post
            My command prompt is on drive U which is my home drive, but I need to get to a file in drive S which is shared files and I can't work out how to do it.
            Maybe this will help? ^_^;>

            To jump to another drive, type letter: example - - S:

            To jump back top the "root" of a drive when you are several folders in --- type cd\ -- example: this will switch from c:\users\erickei\documents to c:\

            Change folders (when foldername is a subfolder of where you are now): cd foldername -- example: cd documents

            Change to a specific folder that is not a subfolder of where you are now: cd letter:\folder1\folder2\folder3 (etc) -- example: cd c:\users\erickei\documents

            Change from current folder to one lower-down: cd .. (that's cd space dot dot) -- example : use that if you are in c:\users\erickei\documents and you want to switch to c:\users\erickei
            Last edited by EricKei; 10-08-2009, 03:22 PM. Reason: one mopre example and that's not how you spell documents!
            "For a musician, the SNES sound engine is like using Crayola Crayons. Nobuo Uematsu used Crayola Crayons to paint the Sistine Chapel." - Jeremy Jahns (re: "Dancing Mad")
            "The difference between an amateur and a master is that the master has failed way more times." - JoCat
            "Thinking is difficult, therefore let the herd pronounce judgment!" ~ Carl Jung
            "There's burning bridges, and then there's the lake just to fill it with gasoline." - Wiccy, reddit
            "Retail is a cruel master, and could very well be the most educational time of many people's lives, in its own twisted way." - me
            "Love keeps her in the air when she oughta fall down...tell you she's hurtin' 'fore she keens...makes her a home." - Capt. Malcolm Reynolds, "Serenity" (2005)
            Acts of Gord – Read it, Learn it, Love it!
            "Our psychic powers only work if the customer has a mind to read." - me

            Comment


            • #7
              Quoth EricKei View Post
              Maybe this will help? ^_^;>

              To jump to another drive, type letter: example - - S:
              I'm either being more or less foolish than I initially thought.

              This just doesn't work. I can get around on the U drive fine, and the rest of your post works fine. The cd .. just takes me to the U drive, and I can't seem to access anything on the S drive (or a seperate P drive, or the C drive).

              Maybe I am actually shut out of accessing the other files like that ? Though I should have unlimited access to the C drive of the computer I'm using, even though I don't have unlimited access to the shared drives of S and P

              Victoria J

              Comment


              • #8
                Quoth EricKei View Post
                Maybe this will help? ^_^;>

                To jump to another drive, type letter: example - - S:
                Then press ENTER!

                So, for our example here, you're on the U drive the prompt most likely looks like this:

                U:\>

                From there, type S: <enter>

                Which should take you to:

                S:\>

                From that point, do your dir command like this:

                S:\>dir /s *.DOC > files.txt

                Replace *.DOC with whatever file type you're looking for. TXT, XLS, whatever.

                Also, you can add /AH after /S to show hidden files.



                Eric the Grey
                In memory of Dena - Don't Drink and Drive

                Comment


                • #9
                  Quoth Eric the Grey View Post
                  Then press ENTER!
                  I did manage that at least.

                  (I'd say I'd never be so stupid but I still burn with embarrassment from the time my father and I ventured into meddling with hardware for the first time with the easy job of replacing a CD drive - yup, pre DVD and pre affordable CDR etc. - and went back to the shop confused when the new drive didn't work. The man in the shop said "You did put a CD in didn't you ?" and we looked at each other, and and ran away as quickly as we could politely do so...)

                  Quoth Eric the Grey View Post
                  So, for our example here, you're on the U drive the prompt most likely looks like this:

                  U:\>

                  From there, type S: <enter>

                  Which should take you to:

                  S:\>
                  Nope. I do that and it pauses for a moment and says "'s' is not recognised as an internal or external command, operable program or batch file."

                  The same for P and C. If it was just P and S I'd think there was something up with the naming of the drives but the C drive is just the C drive. As mentioned above I would also think it could be about lack of permission to access the drives if it wasn't for the inability to access the C drive. When I log on to a computer at my work place you (insanely!) automatically have admin priviledges for the individual computer (but they're not mad enough to do the same for the shared drives and server where you have to log in with the admin account).

                  I think maybe I need to give up on this. You've been remarkably patient (thanks !) but at some point you have to cut your losses.

                  Victoria J

                  Comment


                  • #10
                    Quoth Victoria J View Post
                    Nope. I do that and it pauses for a moment and says "'s' is not recognised as an internal or external command, operable program or batch file."
                    You're most likely right. However, it may be that you just don't map to the drive.

                    Double click on your "My Computer" icon and look at the drives listed there. You'll have an A, C, and your U drive. Probably a D: for your CD/DVD drive. If the S or P drives are not listed, they are not mapped to your computer.

                    If not, you'll need to have your local IT people help you map it. It's a matter of knowing the path to the specific directory tree on the server in question.

                    Good luck.



                    Eric the Grey
                    In memory of Dena - Don't Drink and Drive

                    Comment


                    • #11
                      Quoth Eric the Grey View Post
                      Double click on your "My Computer" icon and look at the drives listed there. You'll have an A, C, and your U drive. Probably a D: for your CD/DVD drive. If the S or P drives are not listed, they are not mapped to your computer.
                      I don't have to try that to know the answer. They're definitely mapped as that's how I get to them sometimes (through my computer). There's A (floppy), C (the individual machine), D (the CD drive), N (an external drive - a national network we're on), P and S (shared drives for programs and files respectively).

                      Thanks for the help, but I give up. This is probably a sign that someone doesn't want me to do what I am attempting to do. This doesn't always stop me (the computer guy knows what I do and sometimes disaproves but has no power to make rules, the manager makes the rules and has no idea what I do because he can barely switch his computer on - I get away with a lot).

                      <--- run free and without care of my idiotic technical problems.

                      Victoria J

                      Comment


                      • #12
                        I'm so very sorry to chime in so long after the battle (I don't often read this section) but this error message is fairly clear.
                        's' is not recognised as an internal or external command, operable program or batch file.
                        This is not what you get when a drive is not mapped on the computer. An unmapped drive would get you somefthing to the effect of "Specified drive couldn't be found".

                        It seems to me that you just typed 'S', and not 'S:'. The colon (':') is what tells the system to switch from the current drive to the one specified by the letter.
                        "I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."

                        Comment


                        • #13


                          I cannot begin to say how stupid I feel now. I seem to have been suffering from colon-blindness*

                          I swear I didn't see those colons. I think I vaguely thought the sentences had full stops after them. (And no - my monitor isn't filthy).

                          I can now change directory.

                          However I still can't get my list. I tried the initial commands suggested by Eric the Grey but managed to make it list 32000 files in the space I'm searching (and only at the prompt which I can't treat like text anyway).

                          I'm not trying to print a list of files in a specific folder - I had a search within a directory (a file which contains a folder for each letter of the alphabet, and a couple of extra folders - which then contain a folder for each client we've saved letters for). Ideally I need to search the actual documents for a text string - but as they are word documents not plain text is that even possible ? Failing that some documents will actually have the company in questions name as PART of the document title.

                          So :
                          • Can I search for a text string inside the word documents in these files ?
                          • How do I search for documents which contain a set string in the name (but not the whole name) ?
                          • And how do I get this output as a text file ?


                          I do feel embarrassed and but I am also so impressed Samaliel - I tend to go from not understanding something at all to having no idea how something can be not understood. I really do admire anyone who knows their subject and can work out where people who don't are going wrong. (Unsuprisingly this makes me a very bad teacher).

                          Victoria J

                          *related to fridge-blindness, the condition where you swear there is no milk in the fridge but anyone else coming into the kitchen can instantly point right at the milk which is right in front of you. This is followed by the person insulting you.

                          Comment


                          • #14
                            Quoth Victoria J View Post
                            So :[*]Can I search for a text string inside the word documents in these files ?
                            Well, you can if you're using Vista or Windows 7. The upgraded Windows Search allows you to check the contents of files as well, though I'm unsure if you could get it to a text file. As for searching document names, use of wildcards would be your friend. Usually a * is used to denote wildcards. So if you were searching for a document that had "Jan12" in the middle, you could just go *Jan12*.doc, and it'd search for anything with Jan12.

                            Again, the issue would be getting it to the text file. That part, I can't help
                            Ba'al: I'm a god. Gods are all-knowing.

                            http://unrelatedcaptions.com/45147

                            Comment


                            • #15
                              I am really sorry if my post made you feel bad. It is not what I intended, and genuinely want to help. Besides, as someone who will occasionnally ransack my own appartment looking for my glasses when they're already on my nose, I know how you feel and can empathize. However, I didn't know how to put it without sounding like smartass, so I kept it as short and factual as I could. Sorry if if came across as offensive.

                              After doing some research, I think the command you need to use is FINDSTR.

                              Given what you said, I think the following will give you what you want:
                              Code:
                              FINDSTR /S /I /M /C:"EvilCompanyName" * > result.txt
                              'FINDSTR' looks for a string in files.
                              '/C:"EvilCompanyName"' defines what it is looking for
                              '*' makes it look in any and every file in the current directory. If you want to limit your search to Word documents, feel free to replace it with '*.doc' or '*.doc*' if you have any Word 2007 (.docx) documents.
                              '/M' makes it return only the file names where it finds it
                              '/S' makes it look in subdirectories
                              '/I' makes it look for the string written in lower-case, upper-case or any combination thereof
                              '> result.txt' makes it write the result in the file result.txt in the current directory.

                              I hope this helps.
                              Last edited by Samaliel; 10-16-2009, 06:38 PM.
                              "I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."

                              Comment

                              Working...