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.

Reply to
Existential Angst
Loading thread data ...

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.

Reply to
PrecisionmachinisT

I was hoping to nudge the 21st century, not the 19th century.

But I am preparing myself for the notebook route.... goodgawd....

Reply to
Existential Angst

A spiral notebook is REALLY quick to thumb through, man.

Reply to
PrecisionmachinisT

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

Reply to
Existential Angst

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 ( *. ) echo -n "$i: " dd if=$i bs=1 count=80 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$EtÊò80+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.

Reply to
DoN. Nichols

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.

Reply to
Existential Angst

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.

Reply to
PrecisionmachinisT

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

Reply to
Jim Wilkins

DOS batch files became Windows shell scripts:

formatting link

There is a powerful scripting language in the free OpenOffice program suite.

formatting link

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

Reply to
Jim Wilkins

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

Reply to
Jon Elson

...

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=80 to dd if=$i bs=1 count=80 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=80 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=80 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=80 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=80 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
Reply to
James Waldby

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...

Reply to
J. Nielsen

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.

Reply to
Robert Roland

If you need to see what is in your programs have a look at this freeware prog

formatting link

DanP

Reply to
DanP

"Existential Angst" wrote in news:51b916d3$0$20213$ snipped-for-privacy@cv.net:

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 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.

Reply to
Neurosis

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.