|
|
|
Removing blank characters in batch
|
Original Message
|
Name: jackngill
Date: April 11, 2006 at 10:22:03 Pacific
Subject: Removing blank characters in batchOS: DOSCPU/Ram: 512Model/Manufacturer: Medion |
Comment: Sorry about all the questions but I have got another one? (Dos7.1 98SE) Is there an easy way (In Batch) to check for blank characters preceding say, some text or a set of numbers in a .TXT or .BAT file. The amount of blank spaces could be 1,2,3 or 4 or greater(No set amount) here's an example: <9spaces>105897 etc etc. Then, after "If Exist" be removed e.g. 106897 etc etc. Regards, Dave
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Mechanix2Go
Date: April 11, 2006 at 12:23:12 Pacific
|
Reply: (edit)Hi Dave, Are you concerned only with leading spaces? ===================================== If at first you don't succeed, you're about average.M2Go
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: jackngill
Date: April 11, 2006 at 13:15:01 Pacific
|
Reply: (edit)Hi Mechanix2Go, U R 1 Kewl Hombre!! Thanks for your reply, did you go any further with the RAMDSIZE. the ram sniffer you looked at for XMSDSK.EXE. MUCHO Gracias Mechanix Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: Mechanix2Go
Date: April 11, 2006 at 13:27:17 Pacific
|
Reply: (edit)Hi Dave, I looked at INT 15 service 88, which is supposed to return XMS info. But it returns no info. I posted a request for help many weeks ago. Nobody seems to know why it doesn't work. Beats me. ===================================== If at first you don't succeed, you're about average.M2Go
Report Offensive Follow Up For Removal
|
|
Response Number 5
|
Name: jackngill
Date: April 11, 2006 at 13:49:02 Pacific
|
Reply: (edit)Well i had a bit of ASM code that a very kindly person amended to spit the Total memory out in decimal Called memsize but hit and miss results. Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 7
|
Name: FishMonger
Date: April 11, 2006 at 23:14:54 Pacific
|
Reply: (edit)Dave, Since you're running Windows, have you thought of using Perl instead of a batch file to remove the leading spaces? This Perl command will do an inline edit of your txt file stripping off the leading spaces from all lines. It also creates a backup of the orginal file. perl -pi.bak -e "s/^\s+//" file.txt ------ M2Go, I don't know the details of your ram issue, but Perl has a module for getting processor and memory info that might do what you need. http://search.cpan.org/~cjohnston/Win32-SystemInfo-0.08/SystemInfo.pm
Report Offensive Follow Up For Removal
|
|
Response Number 8
|
Name: Mechanix2Go
Date: April 12, 2006 at 00:38:45 Pacific
|
Reply: (edit)Hi FM, Where we started into this way back when was to get XMS size in DOS on a boot disk. I have no idea why it doesn't work. The INT 15 may be obfuscated in NTVDM. But INT 21 works OK to get BIOS TIME/DATE. FM & Dave, I think I figured out a way to strip leading spaces in a DOS batch. I'll post it in a couple hours. As ever, perl is the "less filling" code. ===================================== If at first you don't succeed, you're about average.M2Go
Report Offensive Follow Up For Removal
|
|
Response Number 9
|
Name: jackngill
Date: April 12, 2006 at 01:43:57 Pacific
|
Reply: (edit)Hi FishMonger & Mechanix2go, Thanks for the replies firstly. Secondly, Fishmonger I am afraid perl is 2 big & complicated for me to use (Horses for courses & all that). I need to be able to use it within a batch file, but thankyou for your response. Mechanix2go you suggest you may have a way to remove blank spaces in batch, I will await your reply in antiscipation. If there isn't a way to remve the blank spaces before text or a set of decimal numbers, does anyone know of a DOS 3rd party util (Small) that will accomplish this task? regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 10
|
Name: Mechanix2Go
Date: April 12, 2006 at 01:49:30 Pacific
|
Reply: (edit)Hi Dave, I think the BAT I have in mind will only work on a txt file with a SINGLE line. The 3rd party util I use is 737 bytes. Is that small enough? LOL ### NOTE: AFAIK, the perl script can be compiled to a stand-alone EXE ===================================== If at first you don't succeed, you're about average.M2Go
Report Offensive Follow Up For Removal
|
|
Response Number 11
|
Name: jackngill
Date: April 12, 2006 at 04:36:37 Pacific
|
Reply: (edit)Hi again Mechanix2Go, Yes the bat would work for me as i have already reduced the info to a single number on a single line, so i think that would be great! Also the third party util you mention sounds interesting also because if the batch doesn't work for any reason then maybe the gizmo you have will. Do you have a link to the gizmo and is it freeware? As for the PERL script being compiled I'm afaid my ignorance lets me down here. I wouldn't have a clue how to change the afore-mentioned script into a .EXE file & besides if it was an .EXE would that work within a batch file or work on a batch script??? Regards as ever, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 12
|
Name: jackngill
Date: April 12, 2006 at 04:51:20 Pacific
|
Reply: (edit)Second note or observation, Just cus I'm plain nosey I have been to the link above for the perl script and it seems to be in reference to Win32 not DOS, so I don't think, even if I could manufacture the perl script into an .EXE, it would not work anyway! could be wrong???... Irrespective of what will and what won't work, thanks guys for your help and info Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 13
|
Name: Mechanix2Go
Date: April 12, 2006 at 05:29:56 Pacific
|
Reply: (edit)Hi Dave, [1] I'll work up the bat. [2] The 3rd party 'replace str' is here: Change
It's freeware from Ziff-Davis. I got it on disk with the book "DOS Power Tools" in about 1989. It will handle files up to about 30KB. Note the syntax: change[ONE space]filename.ext[ONE space]"[old str]"[ONE space]"[new str]" So to wring out all spaces: change myfile " " "" and run it over and over. Kinda mickey-mouse. Problem is if you have a file like: [9 spaces]35148 etc it will lose the space after the "8". If you need to preserve the other spaces [not at the beginning of the line] you'll need the industrial strength CHANGE.EXE, available here: Change9.11
- If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 14
|
Name: Mechanix2Go
Date: April 12, 2006 at 05:34:09 Pacific
|
Reply: (edit)I don't know if a compiled perl will be a 32 bit or a 16 bit. We'll need to check with FM on that one. I'll compile FM's line and you can try it.
If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 15
|
Name: Mechanix2Go
Date: April 12, 2006 at 06:43:07 Pacific
|
Reply: (edit)Hi Dave, This bat will take a one line text file called dave.txt, strip the leading spaces and put the result in newdave.txt. NOTE: It also reduces strings of multiple spaces to ONE space. NOTE2: It is limited to 9 strings of chars, because of the way the batch inpreter works. ::== dave4.bat @echo off :: This section creates a one byte file, cleverly named 1. > #.d echo e 100 '1' >> #.d echo n 1 >> #.d echo rcx >> #.d echo 1 >> #.d echo w >> #.d echo q debug<#.d>nul > 1.bat echo set str=%%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9 copy /b 1+dave.txt 2.bat > nul call 2 echo %str% > newdave.txt :: DONE
If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 16
|
Name: FishMonger
Date: April 12, 2006 at 08:41:44 Pacific
|
Reply: (edit)Perl scripts/exe's can run on 16 bit DOS or 32 bit Windows and launched from within a batch file. If you want to explore the Perl option, I can work with you on getting perl installed and the script compiled. Or, I can compile it for you and email it to you. The main issue is that the script should be compiled on the same OS version as the target. Currently, I don't have a running Win98 system, but I can get one up in a couple days. The “script” that I posted is actually a perl command, not a full script and besides stripping the leading spaces, it also removes all empty lines which you may or may not be what you want. In this case, it sounds like your txt file is just 1 single line, so this issue may be a none issue. Here's the script version that I would compile. #!perl $^I = ".bak"; while (<>) { s/^\s+(?=\S+)//; print; } --------- Windows port of Perl http://activestate.com/Products/ActivePerl/?mp=1 MS-DOS port http://cpan.org/ports/index.html#msdos
Report Offensive Follow Up For Removal
|
|
Response Number 19
|
Name: Mechanix2Go
Date: April 12, 2006 at 08:54:51 Pacific
|
Reply: (edit)Hi FM, I know I compiled a couple pl's several months ago when we were on the subject of "yesterday" but now I can't figure out how. LOL I've spent several hours flailing around in the online man pages. If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 20
|
Name: jackngill
Date: April 12, 2006 at 10:46:37 Pacific
|
Reply: (edit)Hi all, Well I'm Totally blown away, from what I thought was "I am barking up the wrong tree again" situation it is proving to be very fruitful in many ways. Not just for me, but for others who find themselves in a similair predicament and read this posting. Firstly MANY thanks for the links and comments regarding the white space/Characters info M2GO. I will compile the batch info listed above & experiment KEWL! (Presumeably debug is needed 2). It seems to be just what I am looking for! Also the comments posted by FMonger are very welcome 2. I have visited the link as stated above & there are lots of em, old new etc. I have an XP PC & a win98SE PC but looking at FM's comments I would need a fairly generic version of Perl. I do not want to put you to the trouble of installing 9X just to undertake this task but I am much obliged for the kind offer anyway! I will certainly give the perl option a go, just for the experience. I've grabbed a copy NumenInestperl-5.8.7-2.msi (Hope thats the right 1)15.1Mb's, suitable for 2k XP. Also grabbed copy of Perl2EXE is there a freeware Equivelant, me being a cheap skate LOL? Question, could a script be compiled that would detect the total memory in the way that MEM.EXE does for DOS (One liner), then remove any whitespace/blank characters or lines, then pipe that info into a DOS .BAT or .TXT file for processing? This would remove the need for mem, find the filter progey that I use. Then possibly, do a basic calc like "numberX0.70" with a safe guard of no less than 8192 (8Mb's) to append the created .bat/.txt file. The resultant number variable would be suitable for insertion to determine the xmsdsk size then? I maybe stretching things a bridge too far with this request but it would be kewl if it could be done. Can you post the recipe that you deem appropriate for making the .EXE. Do you need to insert the text into notepad, save as perl.ext & .......? Thanks all for the info & comments etc Regards Dave
Report Offensive Follow Up For Removal
|
|
Response Number 21
|
Name: Mechanix2Go
Date: April 12, 2006 at 11:30:34 Pacific
|
Reply: (edit)Hi Dave, As I said above, I compiled a perl but can't remember how. LOL But it was about 35 to 50KB so no real size advantage over MEM. If you want to pursue the stripping out of one number from a MEM, post the MEM output. If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 22
|
Name: Mechanix2Go
Date: April 12, 2006 at 11:55:55 Pacific
|
Reply: (edit)Dave, You can tweak this; tailor the FIND string. ::== dave5.bat @echo off mem|find "bytes available XMS memory">XMSstr > setSIZE.bat echo set XMSsixe=%%1 > #.d echo e 100 'setSIZE ' >> #.d echo n setSIZE >> #.d echo rcx >> #.d echo 8 >> #.d echo w >> #.d echo q debug<#.d>nul copy /b setSIZE+XMSstr do.bat > nul call do.bat echo available XMSsixe is %XMSsixe% ::DONE
If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 24
|
Name: FishMonger
Date: April 12, 2006 at 13:58:47 Pacific
|
Reply: (edit)Here's how I'd do it in Perl. #!perl use Win32::SystemInfo; Win32::SystemInfo::MemoryStatus(%memory); print map { "$_ => $memory{$_}\n" } keys %memory; ----- The system I'm currently on outputs this: TotalVirtual => 2147352576 TotalPage => 1082515456 AvailPhys => 33275904 TotalPhys => 301514752 MemLoad => 88 AvailVirtual => 2102702080 AvailPage => 773890048 ------ If you only want to retrieve 1 of those fields and only print the value, we can do this: use Win32::SystemInfo; %memory = (AvailPhys => 0); Win32::SystemInfo::MemoryStatus(%memory); print "$memory{'AvailPhys'}\n";
Report Offensive Follow Up For Removal
|
|
Response Number 25
|
Name: jackngill
Date: April 12, 2006 at 14:52:21 Pacific
|
Reply: (edit)Hi Mechanix2Go a Progress report, You are a "very KEWL Hombre", by the left, it works!!!!! Here's what I did, slight adaptation to the first script you posted. I couldn't get the second script to work sorry! Anyway Here goes: created a test.bat running from a 98se boot disk with the following script enclosed: @ECHO OFF A:\MEM.EXE | A:\FIND.EXE /I "Total memory" >> A:\SIZE.BAT (All one line) A:\FILTER.EXE <A:\SIZE.TXT >A:\SIZE1.TXT /D16 A:\FILTER.EXE <A:\SIZE1.TXT >A:\SIZE2.TXT /D32,10 (All 1 Line) A:\CHANGE.COM A:\SIZE2.TXT "," "" > NUL > #.d echo e 100 '1' >> #.d echo n 1 >> #.d echo rcx >> #.d echo 1 >> #.d echo w >> #.d echo q A:\DEBUG<#.d>NUL > 1.bat echo set str=%%1%%2%%3%%4%%5%%6%%7%%8%%9 (All 1 line) copy /b 1+SIZE2.TXT A:\2.BAT > NUL CALL A:\2.BAT ECHO %str% > A:\3.BAT PAUSE CLS :END The following files are produced on the floppy: #D File 1Kb (Contains debug info) 1 file 1kb (Contains "1" only) 1.bat 1kb (set str=%1%2%3%4%5%6%7%8%9) 2.bat 1Kb (1<2Spaces>131008 + on second line <2Spaces>131008 3.bat 1kb (& Finally no leading spaces 131008) Test.bat (The test engine) size.txt (Total memory<6spaces>131,008K<5spaces>2,587K<3spaces>128,421K + repeated again on second line). size1.txt (<2spaces>131,008K<5spaces>2,587K<3spaces>128,421K + second line repeated as above). size2.txt <2spaces>131008 + a repeat on second line 131008. You would need todo a clean up afterwards del all above & SET STR= to clear the variable when the ramdisk is setup. Also at the command prompt I typed SET And "hey presto" there was the "str" number stored as a variable e.g. str=131008 proof! I checked inside the 3.bat file & all the white space/blank characters have been removed. I also timed the whole activity as the nul instruction supressed any screen messages, it took approx 45 secs to accomplish. All I need todo now is do the math with a DOS calc & we are in business. Hope this helps others in variations they may have. Many thanks Mechanix2go Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 26
|
Name: jackngill
Date: April 12, 2006 at 15:13:24 Pacific
|
Reply: (edit)OOP's, sorry FishMonger missed your posting, What if you only have say DOS7.1 installed, No windows, will this script enable you to detect the Total memory in 1 line if only DOS is presant and available? If it will work with Dos7.1 only, how would you assemble compile into an .EXE file? Thanks for your reply anyway, it is appreciated. Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 27
|
Name: FishMonger
Date: April 12, 2006 at 15:37:19 Pacific
|
Reply: (edit)MS-DOS 7.1 is Windows 98SE (if I remember correctly, 7.0 should be Win98a). If you boot from a floppy, you'll be in text mode. When you boot from the HD, it loads the GUI dll's, but you can disable that by editing the MSDOS.SYS file. Perl scripts/programs are normally run in text mode (i.e. from the command prompt). If the script was compiled for the target platform, then it will (or should) be able to detect the memory info and only take at most a couple seconds. The script I posted was written and tested on W2K, but I have 4 non-functioning Win98 systems that I pulled out of my brothers restaurant. I'll see about getting one of them up to test if there are any adjustments that need to be made to the script to work on Win98 (text mode).
Report Offensive Follow Up For Removal
|
|
Response Number 29
|
Name: Mechanix2Go
Date: April 13, 2006 at 00:55:27 Pacific
|
Reply: (edit)Hi FM, What I thought I knew was that when DOS 7x boots it's in 16 bit until the 32 bit kernel loads [with the GUI]. Hi Dave. What is FILTER.EXE? Looks like 3.bat is never used. FM & Dave,
Housekeeping notes: We're on a roll here. It might be worth a couple new threads; probably best in programming forum. [2] Because of the way the forum breaks lines, it might be worth ZIPping and emailng code. If you send me a ZIP change the extension to Z because I have ZIPs blocked. Or use www.yousendit.com If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 30
|
Name: jackngill
Date: April 13, 2006 at 04:37:53 Pacific
|
Reply: (edit)Hi M2Go, I'm still here! Yes I consider the the 3.bat useful, well at least to me it is a reference point should you wish to load & Unload XMSDSK through a menu system. I have been considering shaving the time down, albeit it is running from a floppy for testing & I am considering 2No MEM alternatives which are 3rd party utils, the principle is still the same and may reduce the reliance on MS stuff. Also thought about maybe using >> append a little more so that the cleanup operation is easier afterwards. Does the %%1-9 thingy bear any relationship to the amount of blank spaces proceding the Req number as I could maybe derive less blank spaces to hunt for thus reducing time possibly? what do you think. I think what you have is the basics but needs further tweaking and experimentation possibly? Regards, Dave P.S. Will post the link for Filter.exe shortly when i can find it again LOL!!!
Report Offensive Follow Up For Removal
|
|
Response Number 31
|
Name: Mechanix2Go
Date: April 13, 2006 at 05:30:06 Pacific
|
Reply: (edit)The processing of parameters %1 ~ %9 should take no noticable time. Of more interest on that same topic: This bat preserves the intervening spaces on the 1st and 2nd lines and crams everything together on the 3rd line. :: @echo off echo %1 %2 %3 %4 echo %1 %2 %3 %4 echo %1%2%3%4 :: Notice also that in each case, the LEADING spaces are gone.
If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 32
|
Name: jackngill
Date: April 13, 2006 at 09:47:08 Pacific
|
Reply: (edit)Hi M2Go again, As promised the link and details relating to Filter.exe. This little progey is freeware as is all the utils in the routine we are proposing. It is unique in the respect that it permits the individual deletion of characters within text, selectively say you want to start at character No 8 and work through to say character 25, it will chop them out. It is a bit like a surgical scalple but has many other uses besides. It is in total 34Kb's packed but The filter.exe progey is circa 20KB. For me it does the donkey work of trimming the text/Numbers to a single group for processing. The link is http://hello.to/ferguson# Third down on the list within "Dos Filters" Utils is Filter40.zip, also the text is there to pre-read, it is a.txt file. It does loads more than I am saying here. Come to think of it the Colomn23.zip looks kewl 2, anyway, I digress. Another Question sorry! Could the DEBUG routine be pre-compiled/MACRO & called within batch for the character deletion, say: A:\DEBUG<CHARDEL.TXT>NUL The chardel.txt being the DEBUG instruction set.So all you would need is the precompiled text file todo the work? What do you think of appending more, to reduce the amount of .txt .bat temp files created & the possibility of a menu system with say: 1)Autoload XMSDSK to 70% capacity of PC MEM 2)Check if XMS Memory available 3)Unload XMSDSK from Memory. 4)Quit this Menu! or something to that effect maybe! Could use Ask.com to avoid using Choice & it is a lot smaller 2. Could package the whole lot for distrib, if free. Maybe you could put header details name/date for the cred's mechanix? Also found a very small calc util (CALC387 1Kb in size) that could be used to do the math %Variable%X0.70=XXXXX with a no less than 8192 (8Mb lower limit). Also the % size could be menued for different sizes e.g. 40,50,60,70,80,90% what do you think? Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 33
|
Name: Mechanix2Go
Date: April 13, 2006 at 10:21:08 Pacific
|
Reply: (edit)Hi Dave, Looks like plenty of good stuff on that filters page. Got a link for the CALC387? As far as pre-building files, you could do that and save the space needed for debug, about 21KB. For a DOS menu, without CHOICE, can do. I'll slap something together. If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 34
|
Name: jackngill
Date: April 13, 2006 at 11:19:41 Pacific
|
Reply: (edit)Hi again M2Go, The link for CALC387 1K calc is: http://short.stop.home.att.net/freesoft/calc.htm You will need to scroll down the page approx 1/3 down the long page. Also the ASK.COM (67 bytes) alternatve to Choice.com (5.22Kb). [Always trying to keep it small, trim the fat!] http://www.pc-tools.net/dos/freeware click on it and you will be presented with Dosutils.zip 25.9Kb's (ASK.COM within) lots of other goodies there 2. I will play around with the MEM alternatives filter.exe etc To remove as much MS stuff so to distrib there will be no probs. Was thinking of using Horst TFIND to replace MS FIND.EXE, what do you think? If you wanted 2, CHOIX from Horst's stuff will give you the choice menu with mouse functionality support but a mouse like CTMOUSE would need to be loaded in addition etc. Suppose it could get complicated? One other consideration is if we wanted to run this from read only media e.g. CD etc which would speed up the whole procedure. Could it, in someway, be done in mem, in vars so that no temp files are created & negates the need read/write functionality. This would be additionally advantageous. Sorry about all this brain storming but ironing out the wrinkles does widen the horizens somewhat. Thats me running before I can walk, my appologies. Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 35
|
Name: Mechanix2Go
Date: April 13, 2006 at 11:59:53 Pacific
|
Reply: (edit)67 bytes; my kind of software! I'm still trying to figure out the calc387 syntax. Yes, you could put the temps in a ramdisk to avoid writing to CD/write protected FD. More later If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 36
|
Name: jackngill
Date: April 13, 2006 at 12:55:23 Pacific
|
Reply: (edit)Hi M2GO, Been looking at the Free-dos alt to MS MEM.EXE, exactly the same size & freeware reports mem in the same fashion as MS MEM.EXE will try in combo with Filter.exe & TFIND Horst's stuff. 1 concern I have is it OKAY to post like this or am I breaking any rules as I do not want to upset the computing.net administrators in any way? The perl script from FM may prove useful & have speed benefits, smaller footprint if it can be done, more strings to the bow & all that? Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 37
|
Name: Mechanix2Go
Date: April 13, 2006 at 13:19:03 Pacific
|
Reply: (edit)Hi Dave, I don't see anything in your msgs which might bother the other users. Yeah, perl script is small, but installed perl5 is 52MB. LOL If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 38
|
Name: jackngill
Date: April 13, 2006 at 14:02:45 Pacific
|
Reply: (edit)Hi M2GO, GULP!!!!! 52megs but the .EXE would run independant of PERL surely? Used Free-dos MEM.EXE with TFIND same result, pushed that lot through filter.exe in the same way, same result: <2Spaces>131008 in 3rd .bat Also looked at third party DEBUG from Free-DOS again MS DEBUG (20.5Kb's) & Free-dos DEBUG (19KB's) if you want a link try here: http://chefax.fe.up.pt/mirrors/freedos/files/dos/debug/ Click on Debug98.zip & down it comes, will try it with your script see what happens. Catch ya later on. Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 39
|
Name: jackngill
Date: April 13, 2006 at 14:39:21 Pacific
|
Reply: (edit)Hi again M2GO, Well I interchanged all the MS Progeys with freedos & 3rd party Utils inc DEBUG and exactly the same result SUCCESS!!!! Shaving valuable kb's here & there. It all works, AWESOME! AND Legal 2! Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 40
|
Name: Mechanix2Go
Date: April 14, 2006 at 01:25:32 Pacific
|
Reply: (edit)Dave, Good job. I'm much less interested in legalities than almost anybody you know. I never tried FreeDOS. Years ago DRDOS had many features that M$ did not. I have read here that DRDOS is still 'available' or 'supported'. This link may be of interest: ftp://ftp.fsn.hu/pub/OpenDOS/DR-DOS.703/ I haven't gotten through FILTER yet but but it looks like the ideal companion to CHANGE. If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 41
|
Name: jackngill
Date: April 14, 2006 at 03:32:56 Pacific
|
Reply: (edit)Hi M2GO, I'm working on the menu system now decided to use Horsts CHOIX.COM although it is larger than ASK.COM but smaller than MS CHOICE, If the user so wanted, he/she could add mouse support to the menu, just an added benefit. Also found this out by the by CALC387 need 80387: (Whatever that is?) CALC387 [math_expression] e.g. 1+4*2^3-5/4%1, (Mem+1)^1.5 or E*COS(PI) dunno whether that helps with CALC387. I have also has some LTD success with tweaking CHANGE.COM & Filter.exe & it appears slowly but surely it is coming together. Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 42
|
Name: Mechanix2Go
Date: April 14, 2006 at 05:11:15 Pacific
|
Reply: (edit)Hi Dave, [1] You'd be hard pressed to get anything smaller than ASK. [2] CALC387: I would expect 2^3 to be read as '2 cubed' but it outputs 23 [3] mouse support in DOS is about as useful as a pocket in an undershirt If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 43
|
Name: jackngill
Date: April 14, 2006 at 14:40:06 Pacific
|
Reply: (edit)Hi M2GO, I take it, "Thats its a big fat NO 2 CHOIX then!" LOL! I've got the CALC progey working but it's 2 good it includes decimal places so if I do A:\CALC386 131008*0.7 it calculates 917056.6 I do not think XMSDSK will detect decimal places, only to the nearest whole number! GROANnnnnnn!!!!! Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 44
|
Name: Mechanix2Go
Date: April 15, 2006 at 00:58:41 Pacific
|
Reply: (edit)Hi Dave, The 'syntax help' in the calc387 MSG file isn't much help. By trial and error, I figured out that what you need to avoid the decimal part is: C:\temp\xms>CALC387 131008*.7 91705.6 C:\temp\xms>CALC387 int (131008*.7) 91705 so int () means show result as integer. Since calc387 is so small, I think it's well worth so experimenting to make it do what we want. If anybody can figure out how to do exponents, I'm all ears. Good luck If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 46
|
Name: Mechanix2Go
Date: April 15, 2006 at 02:27:09 Pacific
|
Reply: (edit)Hi Dave, Just stubled onto the trick to exponents. C:\temp\xms>cal 2 ^^ 3 8 C:\temp\xms>cal 2 ^^ .5 1.41421 If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 47
|
Name: jackngill
Date: April 15, 2006 at 05:56:58 Pacific
|
Reply: (edit)Hi M2GO, I 2 have had some success in getting the 70% of 131008 number into a variable, needs another small progey though. So all that is needed is to A:\XMSDSK %TMEM% R: /t /y which translated is: A:\XMSDSK 91705 r: /t /y (However still have not figured the math safety guard of no less than 8192 (8Mb) Will keep ya posted on developments! Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 48
|
Name: jackngill
Date: April 18, 2006 at 15:15:27 Pacific
|
Reply: (edit)Hi mechanix2Go, Just to let u know still here & still working on the memsniffer. I have enlisted an "E" friend who is mobedda than me in batch script. How R U doing? Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 49
|
Name: Mechanix2Go
Date: April 18, 2006 at 15:25:43 Pacific
|
Reply: (edit)Hi Dave, OK here. Somebody needs to figure out why this as, snippet doesn't work: mov ah,88 int 21 ret
===================================== If at first you don't succeed, you're about average.M2Go
Report Offensive Follow Up For Removal
|
|
Response Number 50
|
Name: jackngill
Date: April 19, 2006 at 11:01:25 Pacific
|
Reply: (edit)Hi M2Go, I've got it setup and it works from a menu. Downside, it takes approx 30sec's to setup. I will put together the fileset and details relating to it later as I have got to go out tonight. I will make a 98se minimal DOS floppy with fileset and create winimage file send it to you if you would like a copy and to tweak and improve as you see fit. Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 52
|
Name: jackngill
Date: April 20, 2006 at 04:35:40 Pacific
|
Reply: (edit)Hi M2Go, Well here are the details relating to my hairy attempt at a "ramsniffer". Cryptic Details: 1st on 98SE PC did format /s on floppy disk, added Himem.sys, Emm386.exe Autoexec.bat & config.sys. Also used Gary Tongs IOPATCH v1.4 to patch io.sys so that this routine can be burned to front end of CD. Floppy emulation mode to test on CD (I haven't done so yet!) Next added the following fileset: 1) XMSDSK.EXE (20Kb's)- Ramdisk creator. 2) XMSTAT (8Kb's)- Used in menu to test for HMA. 3) Horst's TFIND.COM (4Kb's)- Used instead of MS Find.exe 4) free-dos MEM.EXE (12Kb's)- Used instead of MS Mem.exe.(Free & smaller) 5)TCALC.EXE (34.5Kb's) - Sorry! I couldn't get CALC386 to input Calculation into VAR. sent "E" to author asking if there is a way. 6)CHANGE.COM (1Kb's) - Used to change text & spacings. 7) COL.EXE (8Kb's) - Used to extract column of specified characters for further processing. 8) IFNUMBER.EXE (8Kb's) - Used to check if calculated number is greater than 8192 (8mb). 9) & Finally don't shout! I have used CHOIX.COM (4Kb's) - As I couldn't get ASK.COM todo loop routines in the menu, however I'm sure you can amend to suit LOL! (Says he, laughing nervously!!!?) 1 observation is that I get a bad command or filename error message just after change.com does it's thing, when calling TMX.BAT dunno why, HELP! However it still loads successfully. Here's what U will get: The floppy disk loads to an intro screen then press any key to continue... offers a menu screen with 4 options (self explanatory). If you choose option (2) a further message screen opens then a tiny ramdisk is created 1024Kb's. Then COL.EXE extracts the REQ text/No's etc, TFIND finds & creates the TMX.BAT. CHANGE.COM Alters text and creates SET = command. (You could at this point add further menu to incrementally add further % options if U wanted?). TCALC does the maths, rounds away the decimal places to a whole number and inputs the calc into a VAR. IFNUMBER.EXE checks to see that the resultant Number is not less than 8mb. Then the 1st small ramdisk is unloaded and the 70% ramdisk from the calc VAR is loaded. Finally a routine clears all the VAR's & I have then made the size of the ramdisk display on the screen to show it works, hopefully! The Ramdisk is hard coded to R:\. Also a very good friend of mine is looking at this using Horsts LMOD & will be in touch once he has figured it out. I have not heard from FishMonger re his perl script as that would consolidate things somewhat. Sorry about my batch scripting but it isn't carved in stone & I'm sure U can MUCHO improve that side of things. Perhaps you could advise on generic pathing for various situations e.g. A:\ CD C:\ C:\DOS etc & no account has been taken in respect of TEMP/TMP file creation. Where do you want me to send the Winimage RAMSNIFF.EXE self extracting file 2? Let me know what you think? Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 55
|
Name: FishMonger
Date: April 20, 2006 at 11:31:14 Pacific
|
Reply: (edit)This thread has expanded quite a lot since my last post. I've been “house sitting” for some friends while they are on vacation, so I haven't had access to my systems to do any testing. They get back today, so I should be able to look at this sometime this weekend. Using Perl just to strip out the spaces won't gain you much (if anything), but if you want to incorporate other portions into the Perl program, then it would be worth looking into. Perl can do most of what you're doing and anything that it can't directly do, it can make a system call to an external command and capture its output. This helps to have better control over the output to the user as well as encapsulating as much as possible in the Perl program. The main thing for me is to not use any Windows API calls, since it sounds they have been stripped out. If you want to zip and email your files to me, I'll see what I can work up. Bear in mind that I need to work this into my scheduling of other projects, so it might take me a little time.
Report Offensive Follow Up For Removal
|
|
Response Number 56
|
Name: jackngill
Date: April 20, 2006 at 13:24:22 Pacific
|
Reply: (edit)Hi FishMonger, We have got a working prototype, its quite clunky but gets the job done. I've made a winimage self extracting file that loads to a bootable floppy & loads the Ramdisk automatically. I have "E" mailed a copy to M2Go, well at least I think i have! If you would like a copy I can forward a copy to you to show you what we are trying to achieve. Afterall many heads R better than one. Regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 57
|
Name: FishMonger
Date: April 20, 2006 at 14:53:29 Pacific
|
Reply: (edit)Hi Dave, Ya, I'd like a copy of what you're developing. I'm not sure if I'll be of much help with your current approach, but I might beable to come up with some Perl alternatives. Ron
Report Offensive Follow Up For Removal
|
|
Response Number 58
|
Name: Mechanix2Go
Date: April 21, 2006 at 01:38:36 Pacific
|
Reply: (edit)Hi Dave, On any attachment to me, drop the last letter of ext; so a.zip becomes a.zi and so on. If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 60
|
Name: jackngill
Date: April 21, 2006 at 03:07:34 Pacific
|
Reply: (edit)Hi M2Go & FM, Resent the "E" Mails with attachments. I realise that your time is at a premium FM but it would be really kewl if this operation could be done in a stanalone perl.exe. However, from experience I have only found MEM to reliably/consistently report back on the total memory available, just an advisory note? Hope you guy's can improve it? Many thanks!!! regards, Dave
Report Offensive Follow Up For Removal
|
|
Response Number 61
|
Name: jackngill
Date: April 21, 2006 at 04:17:52 Pacific
|
Reply: (edit)Hi All again, I've been thinking again, & because basically I am a worrier, I have taken the liberty of setting up a new posting entitled "XMSDSK RAMSNIFFER" within the Dos forum, cus the original posting was about "Removing blank characters in batch" & M2Go has answered that question admirably. This posting has evolved somewhat into another question & is a bit lengthy. Hope you guy's don't mind? Regards, Dave
| |