1. Without seeing MapInfo code (wonder if they will catch a Linux bug and
go open source ;) I would assume that the first line of text data read, or
possibly the first few lines if the routine is more sophisticated, is used
to determine the data type for each field. Since text data does not carry
explicit type information this has to be inferred as the field is read. I
don't understand what Mark means in his reply that they insert a row
*before* the column headings - perhaps he could expand that method.
Depending on how the text data was saved there may be 'white space'
characters (non printable characters such as space and tabs) at the
beginiing of a numeric data field. Some programs interpret that as an
indication of a character field. Look at the first row of data you have
carefully. Are there any missing or null fields? These may default to
character type. What form of delimiting was used? Space delimited, tab
delimted or comma delimited. Experience has shown that tab delimited is
iften the most reliable format to import. Space and comma delimted tend to
create a range of possible leading characters that may be mis-interpreted.
2. If there is no decimal point in the Height for the first data row then
import routines often assume it must be an integer field. If there is a
decimal point then float is assumed.
3. Repeat of some of 1. above. Try changing the delimiter if you can.
Check for null fields in the first row and change that either manually or be
exporting in a different order. Import into Excel and force the entire
column(s) to Numeric type. If the routine is frequently repeated, and the
data is fairly consistent they you could even create an Excel macro to
massage your data before it goes into MapInfo.
Cheer,
John Harrop ([EMAIL PROTECTED])
Cyberquest Geoscience Ltd
- Mineral Exploration Fieldwork
- Computer Geology
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Alan Pritchard
> Sent: Friday, December 17, 1999 3:02 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: MI Problem importing a file
>
>
> I have been trying to import a .txt (although the same problem
> arises with
> the data put into Excel) file of point data into MI, with some odd
> results.
>
> The file consists of a mixture of fields, among which are:
> GeoKey 1234567
> PlaceName Bournemouth
> LatDec 50.1872221
> LongDec -1.8458333
> Population 155488
> Height 30
>
> There are also other character based and numeric fields. The field names
> appear as the top row.
>
> I open the table, and can see the data clearly in the correct column.
>
> When I come to Create Points, though, the only fields that appear in the
> drop down box are the GeoKey and the Height. This is consistent and has
> been confirmed by someone else.
>
> If I look at the table structure, then the GeoKey has been imported as
> Integer, and the Height as Float. The other fields have come across as
> Character [which is presumably why they do not get recognised by Create
> Points]
>
> If I then make a copy of table, and alter the structure so that the
> numeric lat/long fields are changed from Character to Float, then I can
> Create Points and plot the data.
>
> Three questions, then,
>
> 1. Why do only some (2 out of 6) of the numeric fields come across as
> numeric?
>
> 2. Why should the 2 that are recognised as numeric assigned
> different data
> types?
>
> 3. How can I ensure that the lat/long especially are recognised as
> numeric, as it is a real time-waster having to make copies & change the
> structure?
>
> TIA
>
> Best wishes
> Alan Pritchard
> The GLOBAL GAZETTEER: the world on file
> http://www.allm-geodata.com
> ----------------------------------------------------------------------
> To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
>
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]