Thanks, Uffe. That does exactly what I needed it to do. I envy the programming skills that some of you guys have!
------------------------------
Jim
------------------------------
Original Message:
Sent: 03-20-2024 02:16
From: Uffe Kousgaard
Subject: Delete All Columns After Specific Column
As a small mapbasic application, it could look like this:
dim s as string
dim i as integer
dim N as integer
s = "alter table xxx (drop "
N = tableinfo(xxx,TAB_INFO_NCOLS)
for i = 163 to N
s = s+columninfo(xxx,"COL"+str$(i),COL_INFO_NAME)
if i=N then
s = s+")"
else
s = s+","
end if
next
run command s
xxx is the tablename.
------------------------------
Uffe Kousgaard
CEO
ROUTEWARE
Roskilde
Original Message:
Sent: 03-19-2024 15:06
From: Jim Coleman
Subject: Delete All Columns After Specific Column
Is there a way to delete all columns in a table after a specified column name? I have a table named Locations and want to delete every column that exists after a column named Lead_lengt.
Another way to consider it is Lead_lengt is column #162, is there a way to delete all after that column #?
------------------------------
Jim
------------------------------