Importing text changes field names

When I import a text file to a new, empty Pan 6 file, the field names in the first row come in as “order_id”, “first_name”. When the same file is imported to Pan X, the field names come in as “Order ID” and “First Name”. You would think that wouldn’t be a big deal until you realize that almost none of your procedures work because the field names have been changed. This applies to temporary files that are used in processing within procedures. Why are the field names being altered?

I’m not aware of any Panorama 6 feature that does this. As far as I know, Panorama 6 would always create new field names as A, B, C, D, etc.

Perhaps you could be more specific as to what exactly the steps are you are using.

the field names in the first row

Maybe I wasn’t clear but I said the field names in the first row, not the filed names created by Panorama. They are indeed A, B, C …

I am importing text files that were imported with the field names of the program they were exported from in the first row of the data. I then have Panorama change A, B, C to order_id, first_name using the names in the first field programmatically. Panorama X is changing the names in the first row when it is importing them. order_id becomes Order ID so when a procedures moves the field names from the first row to the be the field names of the temporary file, all other procedures doing lookups or grabdata fail as they are looking for the exported filed names.

If I use an OpenFile command in a procedure to import the text into a new database, I get the imported field names in the first row, and the field names of the new database are A,B,C,D,E just like they were in Panorama 6.

If I use “New Database from Text File…” on the File menu, the first row of text becomes the field names, but if I use “New Database from Text File (no field names)…” the first row remains the first row, and the field names, once again, are A,B,C,D,E.

How are you doing the import?

Scratch that, today it is importing the text files correctly. The inconsistencies are annoying. The info(“dialog trigger”) is working today too. Hope it works tomorrow.

If I import this text file:

58 PM

Using ‘New Data Base From Text File (no field names)’ I get the expected results, no data transformation:

16 PM

However (and unrelated to original post), if I use ‘New Data Base From Text File’ only the first field name imports, which seems contrary to expectation:

16 PM

In my tests, the text file had data, in addition to the field names, and I got the correct number of fields. When it imports the data, it apparently adds fields as needed.

1 Like

Confirmed!

Actually, I’m letting the client choose a text file, loading some variables based on the file they choose, opening a file that is used for temporary processing, then importing the text file with the code:

opentextfile “&”+ folderpath( ImportFolder)+ImportFile

Panorama X will NEVER alter the data as it is imported.

If you think about it, how could Panorama possibly know to change “order_id” to “Order ID”? Where would it get that from? I think you need to review whatever process is generating the text file. That must be where the alteration is happening.