The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Hurricane for AutoCAD
 General Discussion
 Count of files found

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Attach a File

Check here to subscribe to this topic.
   

T O P I C    R E V I E W
witz Posted - March 22 2005 : 10:39:25 AM
I would like to get a count of files(parts) found containing certain text. Such as doing a text search and log, I can get a list of the files, (which are our parts), but how can I get a count of these files, their are many parts to our machines.

I am doing a search for the number of parts made with SS, or Delrin. Which can be found doing the search text and log, but other than counting the number of files in .txt file manually, I have not been able to figure out how to get the total number.

Any assistance would be greatly appreciated, Thanks. Love the program. Oh yeah - Has anyone heard or know if this would work with Inventor, or something like this for Inventor?

Thanks again.
17   L A T E S T    R E P L I E S    (Newest First)
Miksteele Posted - March 22 2005 : 5:55:41 PM
WITZ... you wrote:
quote:
I'll just make sure to empty the contents of the file before running, that would seem to be the easiest.


It sounds like you are using the QUEUE to count your files...It may be even easier to just delete the filelist (your output file) prior to running your script. No need to open it.
Miksteele Posted - March 22 2005 : 4:57:05 PM
yeah witz... Don't hesitate to post your ideas. You never know. I at least learned how to change an "a" into a "w" with this one.
Miksteele Posted - March 22 2005 : 4:51:40 PM
awe man... you got my hopes up.

If you go the tag route I think the ones I'd use would be date and time. I can already use the individual month, day and year tags... the date tag however
Admin Posted - March 22 2005 : 4:49:42 PM
NO PROBLEM sbubendorf!

Don't hesitate to post your ideas... your comment might apply to something unrelated... it's all still valuable!!

Regards,
Bill

witz Posted - March 22 2005 : 4:49:04 PM
I'll just make sure to empty the contents of the file before running, that would seem to be the easiest.

Thanks again Witz.
n/a Posted - March 22 2005 : 4:45:52 PM
I think you're right, Bill. I wasn't following the topic in detail. I should have realized that it was being used in a script and being called afresh for each drawing. I'm sorry for misleading all of you.
Admin Posted - March 22 2005 : 4:42:26 PM
Hi Guys...

I think what will happen when you change the "a" to a "w" is that you will only ever get 1 line in your file, as the file will keep getting overwritten each and every time you call the lisp.
(I haven't tried it, but I'm pretty sure this will be the result, let me know if I am full of it!)

I'd pick a TAG that would change each time you run the script... hmmm... maybe this calls for another TAG to be added...

Some sort of "unique" incrementer, that just increments every time the "CREATE AND RUN" button is pressed.

The other option is to add a "KILL [filename]" META Command, but I think that could be dangerous!

Regards,
Bill
Miksteele Posted - March 22 2005 : 4:40:45 PM
Bingo
n/a Posted - March 22 2005 : 4:30:17 PM
Are we talking about:

Lines 53 & 54 of LOG_TEXT.LSP?


; OPEN file for appending as F1.
(setq F1 (open OUTPUT_FILE "a"))


If so, change 54 as shown below and give it a try: (a for append; w for write).:


(setq F1 (open OUTPUT_FILE "w"))
Miksteele Posted - March 22 2005 : 4:22:25 PM
I don't think I can tweak the LSP. I could tell you to throw a TIME TAG in the output field such as:

$HUR_PATH$DATA/$TIME_24$-$USER$-TextLog.lst

But that particular TAG format uses a : as a separator and this will not work in a filename.

If the tag used a different separator that was filename friendly... would it be useable... would it fix your problem or just create a new one for you?
Miksteele Posted - March 22 2005 : 4:03:27 PM
You're right... Well, the OVERWRITE and APPEND options you see in the WIZARD are only referring to the SCRIPT within Hurricane. It allows you to append several search and log tasks.

The output file is controlled in the LOG_TEXT.LSP file. The LSP actually opens the output file (if it exists) for appending. The LSP can probably be tweaked... however I'm not sure I'd be successful. I don't have that much any experience writing LISP. I have had to modify quite a few however. If I'm successful, I'll post here...
witz Posted - March 22 2005 : 3:45:25 PM
Thanks Mike - I got the tags to work, but cannot get the search to overwrite the file, it only keeps adding new file names tot he .lst file. Or .txt file. What ever one I create, I have to open it and then delete the contents to do another search. I have even checked the overwrite box, but it does not seem to do anything.

Thanks, Witz
Miksteele Posted - March 22 2005 : 1:28:47 PM
$HUR_PATH$DATA/$USER$-TextLog.lst is one of the great uses for TAGS.

If you use Project Tags you can get a little more detail. Actually... you'd be able to run multiple projects all in one script but you'd get a separate filelist for each project.

$HUR_PATH$DATA/$PROJECTTAG1$-TextLog.lst
witz Posted - March 22 2005 : 12:28:59 PM
Thanks for the look see, (lower left), that should work fine.
Miksteele Posted - March 22 2005 : 12:22:29 PM
I was going to mention the EDITPAD program too... it's the best TXT editor I ever run into!
Admin Posted - March 22 2005 : 11:53:42 AM
Hi witz,

A few more quick ideas, short of writing some lisp or a VBA routine...

(BTW I've looked online for some lisp routines, and it looks like there are plenty to count BLOCKS, but none that I could find that count occurence of text). (I see a need )

1) You can open the file in Excel (or rename the txt file to csv and double-click for it to auto-open in Excel), and then your row numbers will indicate how many files have the part.

2) You could load the txt file into a text editor like http://www.editpad.com/ (or similar), many text editors will display which "line number" you are on (bottom left hand corner in EditPad).

(I like Miksteele's method the best though )

Regards,
Bill
Miksteele Posted - March 22 2005 : 11:27:21 AM
On the later releases the SEARCH & LOG outputs a LST file. But even if you aren't running the latest version you should be able to paste the following into the OUTPUT FIELD:

$HUR_PATH$DATA/$USER$-TextLog.lst

After the script is complete there will be a nice little FILELIST sitting there for you. Once you double click on it the QUEUE will be loaded and the FILE COUNT appears in the lower left corner.

Hope this helps!

The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.17 seconds. Snitz Forums 2000