Importing CSV with First Record as Field Names


Greetings, new here, so this may have already been covered. I’m opening CSV files in Panorama X with the first record being the field names. Is there a way to get the fields names automatically populated from the first record? Thanks


Yes. You can use code like this:

Loop Left until stopped
Loop fieldname «» right until stopped

and then delete the first record.


Here is a procedure you could run from another database that would both open the CSV file, and rename the fields. It uses a couple of features that are new to Panorama X.

Local folder, file, type
openfiledialog folder, file, type, "TEXT"
if file = "" stop endif
openfile folderpath(folder)+file
for x, 1, info("fieldcount")
    field x+0
    fieldname «»


Both work great, thanks!