Robert sent me his text file. The problem is line breaks in his data. Line breaks are legal in CSV files (as long as the cell is quoted, which they were in Robert’s file), but they are fairly unusual. In my opinion, the assertion that import is completely broken is not justified. Yes, there is a problem with a small percentage of CSV files, probably 1-2% or even less. Very few users will ever encounter this. (Am I saying that Panorama shouldn’t be fixed to handle this case? No, of course I am not saying that.)
When you use the Import Text File into Current Database window, Panorama is doing a lot more than just an import. This panel allows you to rearrange the fields as they are imported, even merging or splitting fields. This is the logic that is not handling line breaks within cells correctly. You started by saying that the import feature should have the “same logic” as create new, but that’s not possible because the capability is not remotely the same. So these features must have at least some separate logic, and a new fix will be needed.
Since in your case the text file already has the same fields as the database you are importing into, you can write a one line procedure to import the text into the current database. (This example assumes the text file is in the same folder as the database.) There’s no need to go to the trouble of creating a new database and importing from it, this one line is all you need.
importtext fileload("some file.csv")
Actually, in Robert’s case he wants it to ignore the first line, which contains column titles, a slight revision will handle that:
importtext arrayrange(binarytotext(fileload("/folder/folder/Sample product-export.csv")),2,-1,cr())
Of course this code could easily be modified to allow the file to be selected with a dialog, using the choosefiledialog statement.
If you’re wondering why Panorama doesn’t have this code built in as a menu item, I believe this case is a rare one. Besides, once the Import Text File into Current Database feature is fixed, this special case code would never be needed.