Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm a beginner to MapBasic and I'm currently working on a tool, I want to export a table as a .csv either using Run Command or Export.

I want to export it to a specific directory, for example C:/Network_checks/Tablename/duplicates. (the table name has been defined as sLayer).

This is what I have tried so far

Export Duplicate_Sections Into "C:/Network_Checks/" & sLayer & "/duplicate_sect.csv" Type "CSV" Charset "WindowsLatin2" Delimiter "," Titles

I've also tried

Run Command "Export ""_6450_HULL_DVI_AllGroups"" Into ""C:/Network_checks/" & sLayer & "/duplicates.csv"" Type ""ASCII"" Overwrite Delimiter "","" CharSet ""WindowsLatin1"" Titles"

But this crashes MapInfo!

I'm pretty sure it's just my " placements!

Thanks, Alan

share|improve this question
    
This is just one line in the code, all lines before this (used to generate the initial table work fine) –  Alan Carr Mar 21 '13 at 14:37
    
You are using / and not \ in your path! –  Peter Horsbøll Møller Mar 22 '13 at 11:57
    
Thanks, that no longer crashes, however I'm getting the error "File duplicate_sect.csv not found. Unable to create new table. Why is it looking for the file? It should be creating it by exporting it. Here is the code I'm using: Export Duplicate_Sections Into "C:\Network_Checks\" & sLayer & "\duplicate_sect.csv" Type "CSV" Charset "WindowsLatin2" Delimiter "," Titles –  Alan Carr Mar 22 '13 at 16:15
    
do you have spaces in path name ? try "C:\Network_Checks" –  sys49152 Mar 24 '13 at 23:04
    
Do you have folder with the name in your sLayer variable in the folder "C:\Network_Checks\"? –  Peter Horsbøll Møller Mar 25 '13 at 10:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.