Author Topic: Search for text string in closed and zipped drawings  (Read 5386 times)

0 Members and 2 Guests are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Search for text string in closed and zipped drawings
« on: October 06, 2005, 10:21:39 AM »
Ok .. I an asking for a bit of help putting this together as I am currently under the gun and don't have time to do the whole shebang .. there are lots of code snippits that could likely be put together to manage what I need but there are also some things that I need to do that I have not seen  code for ... so .....

I need to search a folder (and all subfolders) for a drawing with a plain text string that I will supply .. the caveat is that all drawings are in zipped archives on a remote computer.

Pseudo code
  • Browse for folder (or supply as an argument)
  • create a list of all zip files
  • programmatically unzip each file
  • using ObjectDBX search each DWG file for a supplied dtext string
  • delete temporary files
  • return list of archive files containing the text string and files within the archive that contain the string
  • parse through all subfolders

I could probably do this in VB as well .. it may be easier .. anyway, depending upon the direction this takes I will move it to the proper forum.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Search for text string in closed and zipped drawings
« Reply #1 on: October 06, 2005, 10:41:05 AM »
What I could help out (ObjectDbx, recursive directory scanning, text searching et al) you already know. All I can suggest is maybe taking advantage of winzip's command line interface.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Search for text string in closed and zipped drawings
« Reply #2 on: October 06, 2005, 11:36:20 AM »
Couldnt you make a batch file to do this for you? (GNU, has all the commandline (un)compress utills you need.)

You could to a search with lisp, then do a findstr/batch file  in a shell [(defun shellthis (c) (command "sh" c))] and create a text file, then read that text file in lisp again. (and ofcourse delete the file with lisp.)

how does that sound?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Search for text string in closed and zipped drawings
« Reply #3 on: October 06, 2005, 11:49:49 AM »
Well, considering that I have to search in a closed DWG file I doubt it would work .. ObjectDBX is the solution .. but alas I will have to decompress (we don't use winzip) the dwgs from a zip and report the drawings ... I have 12 years of drawings I must research and this will no doubt take many days and possibly weeks ... unless I can automate it .. and as I said previously I am sort of under the gun and don't have too much time to devote to this right at the moment ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

hendie

  • Guest
Re: Search for text string in closed and zipped drawings
« Reply #4 on: October 06, 2005, 11:56:24 AM »
Keith, you're using 2000 there aren't you ?
Superfind would do it although I'm not sure about the zipped folders.. it's been a while since I used it

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Search for text string in closed and zipped drawings
« Reply #5 on: October 06, 2005, 01:27:19 PM »
You can use just regular search in windows if its just a text string.

...Awe hold on. Let me create an example for you.

Extact this archive and open the folder (BatchTest) and dblkclick the .cmd file
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Search for text string in closed and zipped drawings
« Reply #6 on: October 06, 2005, 04:43:15 PM »
Interesting ... I didn't think that you could search a DWG file for a text string .... you learn something new every day ...
I'll give it a shot ... I should be able to batch something relatively simply ..
Thanks ..
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Search for text string in closed and zipped drawings
« Reply #7 on: October 06, 2005, 05:03:01 PM »
Cool huh?!

Batch scripts are cool! And you can call them from a lisp too. (Like my example above.) They can make for fast work.

story: At the last office i was at they replaced the server and the company hired a seperate IT company to come out and do the switch. They had two guys out for hours (late at night) going to each and every machine unmapping and remapping dirves i guess. So when i showed a guy in the office how cool batch scrips were, i just happned to pick the topic of maping drives. I quickly whiped up a lil batch to map all my drives up. (the script did about 10 maps in less then a second) all he did was laugh. At the time i was kinda annoyed with his attitude, but then later he told me about how much moeny the company must have spent having those two guys out remapping drives i kinda understood. (Such is life. OBTW, we never told the higher ups.)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Search for text string in closed and zipped drawings
« Reply #8 on: October 06, 2005, 05:36:51 PM »
Very cool John. :-)

Speaking of Zip files, here is another program I use.
http://www.pdf995.com/suite.html

I have it set up so that I can run my PlotTabs Routine & print an entire drawing (8-12 tabs)
to pdf files hands free so to speak.

Sorry I digress.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Search for text string in closed and zipped drawings
« Reply #9 on: October 07, 2005, 08:49:44 AM »
I have done hundreds of batch programs, I even wrote batch programs that did things batch programs were not supposed to be able to do ... many years ago I investigated the possibility of a text based memory resident virus ... to this date I have not ever seen anything like it in the wild, but I successfully created a self replicating text based batch file.

Back to my original comments ... I thought that the entity information in a drawing was compressed to the point that you could not determine if a specific text string existed by doing a text search on the DWG.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Search for text string in closed and zipped drawings
« Reply #10 on: October 07, 2005, 08:53:51 AM »
Well then your an old hand at 'em. (You need to be teachin me!) I know those things can get uite involoved. MP re-did a batch for me and i still refer to it for help. It just has so much i can learn from in it.

So did you preform the search yet or is that sched for this weekend? (How did it work?)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Search for text string in closed and zipped drawings
« Reply #11 on: October 07, 2005, 09:03:23 AM »
I have adjusted the routine to search for the string I need to find and a few other minor tweaks .. but I still need to add recursion to it ..

I'll post the code when I get it done ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

M-dub

  • Guest
Re: Search for text string in closed and zipped drawings
« Reply #12 on: October 07, 2005, 09:40:16 AM »
I know it's late in the game here, but I was going to post a link to DrawingSearcher (Now called Docupoint Discovery) which does a string search through all of your dwg's (to make a long story short), but I tested it with zip files and it doesn't help with that.  That's why I didn't post this link -> www.docupoint.com

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Search for text string in closed and zipped drawings
« Reply #13 on: October 07, 2005, 09:46:51 AM »
Kinda late in the day and I didn't see anyone post this (forgive if they did and my coffee bereft eyes didn't see it) but there is the DOS find command (supports redirection), which can be used with the for command.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Search for text string in closed and zipped drawings
« Reply #14 on: October 07, 2005, 09:53:44 AM »
I used "findstr" would that be a good enough?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org