• Welcome to Orpington Astronomical Society.
 

News:

New version SMF 2.1.4 installed. You may need to clear cookies and login again...

Main Menu

Calling All MS Dos Batch Programing Experts...

Started by JohnP, Jan 15, 2009, 18:11:31

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

JohnP

Hi All,

Skymap Pro has the Hubble Guide Star Catalog (HGSC) included however, it is in a compressed form (just a single Dat file).... but they also provide a MS Dos program that will enable you to uncompress the original HGSC. The prog only compresses one file at a time & there are 9537 to do...

The command to extract a single file is:

c:\gscrgn d:\ 001

Where gscrgn is the extract file they provide & d:\ is the location of the compressed file. 001 is the name of the file I want to extract.

Problem is I want to extract ALL 9537 so I'm guessing I need to write some sort of batch file that has a counter that increments by 1 & loops from 0 to 9537...

Does anyone know how to write this - I haven't got a clue....?

I found this on the web which I think is close if I modify it...

set _number=0
set _max=10
:Start
if %_number%==%_max% goto end
echo %_number%
set /a _number=_number + 1
goto start

:end
set _number=
set _max=

So based on above I was thinking something like...

set _number=1
set _max=9537
:Start
if %_number%==%_max% goto end
c:\gscrgn d:\ %_number%
set /a _number=_number + 1
goto start

:end
set _number=
set _max=



Thks,  John

Ian

I thought you were going to call them something rude mate...

Apologies for not actually having anything constructive. I'm sure you can PERL it, you'll have to get PERL for windows (not that hard).

Mac

why dont you use a batch file, a bit easier,
use excell to knock it up.

heres one i prepared earlier.

http://www.macrhon.co.uk/website/misc/gsc.bat

The way i got this to run was to map a drive letter to where i installed skymappro.
so using tools map drive on windows explorer
i mapped the R:\ drive to the following folder

\\192.168.1.4\e$\Program Files\SkyMap Pro 10\



192.168.1.4 being the ip address of the machine i was on (laptop)
\e$\ is an administrative access share to the E drive on my machine


then using a dos prompt
from r:\Program Files\SkyMap Pro 10\Star\GSC\

i coppied the batch file to this directory and run it,
it quite happily unzipped all the files, although i stopped it at 37.

You might have to change the following setting to get it to work though,
on windows explorer, goto to tools, folder options, and scroll down to the bottom,
and just untick the use simple file sharing,
that way you can share to your own drive using the admin share above.



JohnP

Hi Mac - Thks for that the Excel Batch looks good - No idea how you did it though - I may need to give you a quick call when you are not too busy (so in about 6 months or so I reckon....)

Thks,  John

Mac

yup give us a ring any time,
If im busy, ill just ignore you. :lol:


The other way you could do it is to use the subst command
open a dos box and type subst r:\ "x:\Program Files\SkyMap Pro 10"
where x:\ is your install directory for sky map

That way you can just goto the R:\ directory

failing that i'll always un compress the files and then rezip them,
but i dont know how small they will go.

JohnP

Mac - Anychance you can pm me your phone number/ mobile (or send me an email).. Cheers mate.