macro to get dbf data finds complex file names confusing

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

joosts
Posts: 5
Joined: Thu Sep 27, 2012 9:23 am

macro to get dbf data finds complex file names confusing

Postby joosts » Thu Sep 27, 2012 9:43 am

I want to load a large number of dbf files and merge them into one .sav . I'm getting a very interesting error.

Here's the first part of the macro:

DEFINE inlezen (!POS !CHAREND('/'))
!DO !i !IN (!1)
!let !naam=!concat('data',!i).

GET TRANSLATE
FILE=!quote(!concat('G:\BZ\2_10_Stadsobservatie_statistiek\2_10_03_Monitors_studies\Onderwijs_basis\schoolfiches\proefdraai_output\',!i,'.dbf'))
/TYPE=DBF /MAP .
dataset name !naam.

!DOEND
!ENDDEFINE.

inlezen
25551_1
25551_2 /.

The funny thing is: it works just fine for files like 255.dbf or a255.dbf and even a255_1.dbf . But 255_1 of 255a1 does not work. Anyone got an idea as to why and how to avoid this problem?

The DBF's are an export of a python script run on a feature layer in ArcGIS, where a unique identifier is used as the filename. This makes it easy, as the unique filename is also what I need as a variable. So I could build a workaround where I add a field to my features, or in the python script. But that makes it considerably less elegant, easy and flexible.
I thought this might be a bug...
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: macro to get dbf data finds complex file names confusing

Postby Penguin_Knight » Thu Sep 27, 2012 10:53 am

Underscore ( _ ) does not work in macro.
joosts
Posts: 5
Joined: Thu Sep 27, 2012 9:23 am

Re: macro to get dbf data finds complex file names confusing

Postby joosts » Thu Sep 27, 2012 11:03 am

That's not the case on my version.

a252_2.dbf does work.
252a2.dbf does not work.

Who is online

Users browsing this forum: No registered users and 2 guests

cron