20th century file handling.... Haas....

Here's what I would like to find: A dos/windows utility that will do a file list by file name AND print out the first 80 characters or so of text in the file, next to the file name.
The reason is this:
First, note that the Haas controller does exactly this. And, good thing too, because the way the Haas saves files, it uses ONLY the O-word file *number* as the dos/windows file name!! So the first 80 characters is a good heads up as to whazzup with the file..
However, when the file is saved to a flash drive, the ONLY thing you see is the O-word file number as the file name, with no description whatsoever. So it's impossible, after a while, to know what's what.
I don't think I can save to different file names directly from the Haas controller, but even if I could, this would proly be just another level of confusion. So the above-described utility might be a way having/eating my cake. Would be nice if the utility would also let me call the file, and kind of Explorer++, like notepad++.
The Fadal, otoh, gives you dos-like control, using either the O-word # or a dos file name of your choice. 'course, 8 letters is a little restricting after a while, but at least it's sumpn. With the Haas, you got nuthin, once yer away from the controller.
Any advice appreciated.
--
EA





Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Put it in a spiral notebook...
Or maintain a notepad folder on your computer desktop, with a subfolder for each part number that you make.
A printable cutting tool list is really handy thing to have, BTW.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload


I was hoping to nudge the 21st century, not the 19th century.
But I am preparing myself for the notebook route.... goodgawd....
--
EA



Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload


A spiral notebook is REALLY quick to thumb through, man.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload


Sheeit, in that case, I shoulda just buzzed out the sides of the Fadal cabinet, put in 10 ft ball screws, changed the limits, and saved myself $90,000..... AND I'd have DOS file names!!!! LOL
--
EA




>
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

80x 30 is the largest table the fadal firmware supports but I think that is only when running in jog mode..
David Jr. possibly has a complete retro board by now, judging from our last conversation.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

The backup program I use allows a file to include a descriptive text string similar to what you want, visible in its directory display, but to me it's easier to catalog the backups in a text file as I create them, using key words or symbols that I can search for later. I enter the filename and description in the catalog first, reconsider and edit them, and then copy and paste them to the backup file while creating it.
The most useful key word has been the date string which appears when I first create a backup file and every time I reuse it, since the catalog is really a log of everything I do with the computer.
The log for this computer is at 288,417 bytes, far too big to search by eye. Recently I extracted every Internet purchase from it by searching the keywords "ordered" and "bought" and copying the surrounding block of text to another file, which I then edited.
An imperfect, unplanned Search like that works as long as it pulls up every reference to a project, even if it also brings in some junk. I can edit one or two pages of text easily.
Over the years I've changed how I tag different types of entries. With Wordpad it's easy to search and replace the old tags with the new ones. I can change the way I index records, which would be difficult for directory names and text in many files.
If you're feeling ambitious it's possible to write a DOS QBasic program that manages an NTFS file database. Install XP or 2000 on a FAT32 drive and issue NTFS shell scripts from QBasic running in NT Virtual DOS Machine to manipulate the files. I did that to extract connect and disconnect times from the Modem Log when I had a 50 hours / month dialup connection.
jsw
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Wed, 12 Jun 2013 22:19:07 -0400, "Existential Angst"

I'm grittin' my teeth on Haas controllers at the moment - After thirteen years running a Cincinatti with Acramatic 2100 control I never thought I would be missing a NT based control, but there you are... Has time stood still in Haas land? I feel like I'm back in the eighties again.
Maybe I'm not being fair; it could be the "old dog, new tricks" syndrome at work, but compared to the Acramatic, the Haas control sucks big time. And don't get me started on the canned cycles! More like banned cycles...
--

-JN-

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

    Well ... if you were using unix/linux it would be easy. (And if you install the (free) CYGWIN package, you get the utilties needed for that.
    It would be a shell script (like the old "BATCH" files in MS-DOS but on steroids, with lots of extra tools around to make life easier.
    I forget which shells are supplied in CYGWIN, but I would probably write it in zsh, and it would look something like this:
=====================================================================#!/bin/zsh # foreach i ( *.<whatever-extension-those-files-have> )     echo -n "$i:    "     dd if=$i bs=1 count     echo "" end ====================================================================and here is an example of the output (without locking it to a specific extension:
=====================================================================dnicholsswup.trc.sKaigd: user is not registered HOMEDIR=/home/popocat/dnichols/.softwareupdate/83362cb3 d80+0 records in 80+0 records out BFB$Et80+0 records in 80+0 records out +5
en: read: Is a directory 0+0 records in 0+0 records out
first-line: #!/bin/zsh # foreach i ( * ) echo -n "$i: " dd if=$i bs=1 cou80+0 records in 80+0 records out
=====================================================================A little bit ugly, because I don't know a way to suppress the "records in" and "records out" reports. If you want to specify a number of lines, instead of a number of characters, that is easy , just use "head -5 $i" in place of the dd invocation. But you really want to use the extensions then, because binary files may go a lot of output (and do weird things to the display) before it gets even the first line past. :-)
    And -- you would probably have to modify the path to zsh which I put in the first line. I forget where CYGWIN puts the shells.
    Enjoy,         DoN.
--
Remove oil spill source from e-mail
Email: < snipped-for-privacy@d-and-d.com> | Voice (all times): (703) 938-4564
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

Hmmm...... Linux is waaaay beyond my testosterone level, but if it's sumpn like a dos batch file, my BIL is a C++ programmer, mebbe he can kluge sumpn up for me.
--
EA


>
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

DOS batch files became Windows shell scripts: http://www.csie.ntu.edu.tw/~r92092/ref/win32/win32scripting.html
There is a powerful scripting language in the free OpenOffice program suite. http://www.openoffice.org/udk/common/man/tutorial/office_automation.html
Put the string MsgBox "Hello World!" in a new Notepad file and save it to the Desktop as Hello.vbs. Then click on it.
ZAP, you're a Windows programmer! jsw
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thursday, 13 June 2013 05:57:13 UTC+1, Existential Angst wrote:
If you need to see what is in your programs have a look at this freeware prog http://www.cncedit.com/Basicviewer/Features.aspx
DanP
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Thu, 13 Jun 2013 04:35:49 +0000, DoN. Nichols wrote:
...

...

dd's records in/records out report is directed to stderr so can be suppressed with a 2>/dev/null redirection. (Standard error uses file descriptor 2.) Eg, change dd if=$i bs=1 count to dd if=$i bs=1 count 2>/dev/null
Note, this also suppresses the "Is a directory" message.
dd is fine for printing just the first line if you know that lines are stored as fixed length records; and head is fine if you know each line ends with a newline; but to be general I suppose both need to be used. Eg, dd if=$i bs count=1 2>/dev/null | head -1
An example (where % represents command line prompt): % cat $i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
% dd if=$i bs count=1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301+0 records in 1+0 records out 80 bytes (80 B) copied, 5.1124e-05 s, 1.6 MB/s
% dd if=$i bs count=1 2>/dev/null 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 % head -1 $i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
% dd if=$i bs count=1 2>/dev/null | head -1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
--
jiw

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Existential Angst wrote:

Sad, they had to dumb it down for machinist who are still stuck in the paper tape era!
With LinuxCNC, you can group the files in directories related to specific projects, makes things a lot easier to find after you have lots of files floating around. Also, keeps track of last modification date, which is often helpful to make sure you have the right version of the file. And, it is on the network, so loading new files is easy, and backup is also easy.
Jon
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Wed, 12 Jun 2013 20:48:22 -0400, "Existential Angst"

As macinists say: If you can't find it, make it.
Here a *very* barebones Vbscript example:
Set fso = CreateObject("Scripting.FileSystemObject") For Each f in fso.GetFolder(".").Files     Set d = f.OpenAsTextStream(1,0)     Wscript.Echo f.Name & " : " & d.Read(80)     d.Close Next
Paste the text into a text editor and save it as x:\somewhere\something.vbs.
Call it using cscript x:\somewhere\something.vbs
It will list *all* files in the current directory and attempt to display the first 80 bytes as ascii text.
There is absolutely no error checking or any attempt at filtering the data. If a file is shorter than 80 bytes, the script will crash. If a file is binary, your computer will print gibberish and beep like mad. If a file contains line breaks, the printout will have line breaks as well etc.
As you can tell, this is mostly useful as an example, not as an actual useable product.

It would, of course, be entirely possible to make a nice graphical application with lots of bells and whistles. It would take some time, though.
--
RoRo

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

If you are using Windows 7 Professional this can be fairly simple using Powershell and "get-content" command.
Open a command prompt in the directory containing your files <shift-right click> open command prompt here.
powershell -command "& {get-content file-name -totalcount n}"
You can use a wildcard for the file name if you want to list all files. n is the number of lines that you want to list.
C:\Users\Pgm\Desktop\files>powershell -command "& {get-content * - totalcount 5}" % O5902( HM59OP2.NCF )G99 ( TOOL 1O 0.03125 RAD. 80-DEG. DIAMOND )/N0M89 N1G0G40G54 G30U0W0T0100 % O1721(3-55855-1 OP1)G99 /N0M89 N1G0G40G54X10.Z6.T0100M8(CNMG 432) N2G50S2000 % O5855(3-55855-1 OP2) /N0M89 N1G0G40G54 N2G30U0W0T0100M8(CNMG 432) % O5196(6-35196-1 OP1) M89 N1G0G40G54 N2G0G28U0W0T0100(CNMG 432) % O5197(6-35196-1B) (ROUGH O/D) (CNMG 432) N1G0G40G54 % O3111(696-036-173-111 OP1)G99 /N0M89 N1G0G40G54 N2G0G30U0W0T0300M8(VNMG 331) % O0002(696-036-173-111B) N2G0G40G54 G28U0W0T0100M8(CNMG 432) N3G50S2000 % O8179( 69B81791-3A.NCF ) G99 ( TOOL 1O 0.03125 RAD. 80-DEG. DIAMOND ) N1G0G40G54 % O1791( 69B81791-3B.NCF ) N1G0G40G54 ( TOOL 2O 0.01563 RAD. 80-DEG. DIAMOND ) N17G30U0W0T0100
The command doesn't list the file name next to the output but if you get creative that shouldn't be a problem.
You can easily direct the ouput to a file if you like.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.