搜索

我初学mapinfo10,讲txt文件导入后,转换为tab文件,但是tab文件只有1k,而且不可编辑,怎么办

发布网友 发布时间:2022-04-21 10:03

我来回答

3个回答

热心网友 时间:2023-11-09 02:40

另存成mapinfo自己的格式就可以修改了。
mapbasic写excel数据,需要用DDE相关的命令。自己在帮助里面找关键词。

下面是 Example

Dim chan_num, tab_marker As Integer
Dim topiclist, topicname, cell As String

chan_num = DDEInitiate("EXCEL", "System")
If chan_num = 0 Then
Note "Excel is not responding."
End Program
End If

' Get a list of Excel's valid topics
topiclist = DDERequest$(chan_num, "topics")

' Topics in the list are separated by tabs.
' If Excel 4 is running, topiclist might look like:
' ": Sheet1 System"
' (if spreadsheet is still "unnamed"),or like:

' ": C:Orders.XLS Sheet1 System"
'
' If Excel 5 is running, topiclist might look like:
' "[Book1]Sheet1 [Book2]Sheet2 ..."
'
' Next,extract just the first topic (e.g."Sheet1")
' by extracting the text between the 1st & 2nd tabs;
' or, in the case of Excel 5, by extracting the text
' that appears before the first tab.

If Left$(topiclist, 1) = ":" Then
' ...then it's Excel 4.
tab_marker = InStr(3, topiclist, Chr$(9) )
If tab_marker = 0 Then

Note "No Excel documents in use! Stopping."
End Program
End If
topicname = Mid$(topiclist, 3, tab_marker - 3)
Else
' ... assume it's Excel 5.
tab_marker = Instr(1, topiclist, Chr$(9) )
topicname = Left$( topiclist, tab_marker - 1)
End If

' open a channel to the specific document
' (e.g. "Sheet1")
DDETerminate chan_num
chan_num = DDEInitiate("Excel", topicname)
If chan_num = 0 Then
Note "Problem communicating with " + topicname

End Program
End If

' Let's examine the 1st cell in Excel.
' If cell is blank, put a message in the cell.
' If cell isn't blank, don't alter it -
' just display cell contents in a MapBasic NOTE.
' Note that a "Blank cell" gets returned as a
' carriage-return line-feed sequence:
' Chr$(13) + Chr$(10).
cell = DDERequest$( chan_num, "R1C1" )
If cell <> Chr$(13) + Chr$(10) Then
Note
"Message not sent; cell already contains:" + cell
Else
DDEPoke chan_num, "R1C1", "Hello from MapInfo!"

Note "Message sent to Excel,"+topicname+ ",R1C1."
End If
DDETerminateAll
追问我就是想问如何转换成mapinfo自己的数据啊,我文件菜单的“保存表”是暗的,“另存副本为”可选,但是另存后还是只有1k,怎么办

热心网友 时间:2023-11-09 02:41

是TXT文件?TXT转过去有用吗

热心网友 时间:2023-11-09 02:41

转换时看看默认的保存路径是在什么地方
声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。
E-MAIL:11247931@qq.com
Top