Hi Soren,
This is off topic for this newsgroup, and you can find a lot about DOS batch
scripts by doing a Google, but the following batch script will probably do what
you need:
@echo off
for %%a in ("*.mif") do (
tab2tab.exe "%%a" "%%~na.tab"
)
The above loop will process every MIF file in the current folder and for each
will run the command: tab2tab "X.MIF" "X.TAB" where X is the filename minus the
extension. The %%~na notation means get just the filename. You can also use
%%~xa to get just the extension. Note that I've used double quotes around
filenames in case they contain spaces.
Cheers,
Anthony.
--- On Mon, 27/10/08, Soren Lindqvist <[EMAIL PROTECTED]> wrote:
From: Soren Lindqvist <[EMAIL PROTECTED]>
Subject: Re: [mitab] Converting tab to mid/mif and mid/mif to tab from a
certain folder using batch
To: [email protected]
Received: Monday, 27 October, 2008, 9:30 PM
Thanks Daniel,
Does this mean you must have the tab2tab.exe in the same folder as all the tab
files?
I tried with
@echo off
Cd d:\data\mitab- 1.70-win32
tab2tab.exe d:\data\test\ test1.tab d:\data\test\ test1.mif
Or
tab2tab.exe d:\data\test\ test*.tab d:\data\test\ test*.mif
But I can’t get it to work... Something wrong here?
Regards
Soren
On 10/27/08 10:07 PM, "Daniel Morissette" <dmorissette@ mapgears. com> wrote:
Sören Lindqvist wrote:
> Hello!
>
> Can someone help me with this command. I have a folder lets say D:\Data\ that
> contains 50
> tab and its related files. I want all of this files to be converted to
> mid/mif to the same folder
> by using a DOS batch script, then later in the process convert back to tab
> files into the same
> folder with overwrite or a to a new folder for convenience.
>
> I am not a programmer and have little experience in coding, so an easy way is
> recommended
> :)
>
> I downloaded MITAB but I cant understand how it should be used or installed
>
The tab2tab.exe program (in the MITAB Windows download package) is what
you'd use to convert a single file between MIF and TAB formats.
e.g.
tab2tab.exe source.mif target.tab
or
tab2tab.exe source.tab target.mif
Unfortunately the tab2tab program doesn't contain any logic to loop
through all files in a directory. If you're on Windows then you can
write a loop in a batch file to do that. The following Blog seems like a
good tutorial:
http://jamesewelch. wordpress. com/2008/ 05/01/how- to-write- a-dos-batch-
file-to-loop- through-files/
Daniel
Make the switch to the world's best email. Get Yahoo!7 Mail!
http://au.yahoo.com/y7mail