Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7138 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

FM7, In a scripted import, it possible to have the file type set to "Text" (instead of defaulting to "Any File") but still allow the user to pick a file? In experimenting with various settings I thought that I had figured out a way to do this, but now it doesn't seem to work.

The problem is that I have one file, which if import as "Any" will be determined to be CSV by filemaker instead of Tab-delimited text, which messes up the import.

Posted

No, the first time through the user must pick "file of type". Subsequent imports (in that session) will then use the last "type" selected

If it's possible to keep the name and path of the import file the same, save it in the script. Then, the "type" will also be saved (try it)

Posted

Thanks. I wonder if another approach might work. It seems that FileMaker pays some attention to the file type. I wonder if naming my data files as ".dat" instead of ".txt" might keep filemaker from picking CSV instead of Tab-Delimited text when importing a text file?

Posted

FileMaker does pay attention to the extension of the imported file. That is used to determine which import filter FileMaker uses to convert the imported data.

Posted

FileMaker does pay attention to the extension of the imported file. That is used to determine which import filter FileMaker uses to convert the imported data.

Posted

FileMaker does pay attention to the extension of the imported file. That is used to determine which import filter FileMaker uses to convert the imported data.

Posted

FileMaker does pay attention to the extension of the imported file. That is used to determine which import filter FileMaker uses to convert the imported data.

Does anyone know the complete list of mappings?

I'm specifically concerned with what TEXT file extensions will be interpreted either as "Tab Delimed" vs. "CSV"?

Posted

FileMaker does pay attention to the extension of the imported file. That is used to determine which import filter FileMaker uses to convert the imported data.

Does anyone know the complete list of mappings?

I'm specifically concerned with what TEXT file extensions will be interpreted either as "Tab Delimed" vs. "CSV"?

Posted

FileMaker does pay attention to the extension of the imported file. That is used to determine which import filter FileMaker uses to convert the imported data.

Does anyone know the complete list of mappings?

I'm specifically concerned with what TEXT file extensions will be interpreted either as "Tab Delimed" vs. "CSV"?

Posted

Interesting. It appears that if the setting is "All Available," and you import a .csv file, it will line up correctly. If you open the Import dialog afterwards you will see that it is set to "comma-separated." If you then choose a .tab file it will NOT import correctly at that setting; but it will if you change it back to "All available."

So it pays attention to the type of file for the import, if the setting is "All available," then it changes the setting to what that import was. Useful from a manual point of view, not so much from a scripting point of view. Because there is no option to knock it back to "All available" if it's currently something else without specifying a fixed file to import. The script step seems to also have that last setting by default.

I thought of a kludge to reset it with a script. Export (no dialog) a text file of the type you want, a very small file, 1 record, 1 field, with the file name and type set. Then import it. Delete the record.* Then run your other Import, with dialog. It should be set up correctly.

*If you choose the "first row is field names" option then it won't import a record, and it will change the import type. Sneaky :-]

Or, on a Mac, use AppleScript to put up the dialog to pick the file. Rename/move or copy it to a fixed location. Import with a fixed import step. Rename/move it back, or delete it. (I depends how big the file is whether moving it back and forth is worth while. Unless it's quite big, it's easier to duplicate it to the fixed location in one step, then delete the duplicate afterwards.)

Posted

Interesting. It appears that if the setting is "All Available," and you import a .csv file, it will line up correctly. If you open the Import dialog afterwards you will see that it is set to "comma-separated." If you then choose a .tab file it will NOT import correctly at that setting; but it will if you change it back to "All available."

So it pays attention to the type of file for the import, if the setting is "All available," then it changes the setting to what that import was. Useful from a manual point of view, not so much from a scripting point of view. Because there is no option to knock it back to "All available" if it's currently something else without specifying a fixed file to import. The script step seems to also have that last setting by default.

I thought of a kludge to reset it with a script. Export (no dialog) a text file of the type you want, a very small file, 1 record, 1 field, with the file name and type set. Then import it. Delete the record.* Then run your other Import, with dialog. It should be set up correctly.

*If you choose the "first row is field names" option then it won't import a record, and it will change the import type. Sneaky :P-]

Or, on a Mac, use AppleScript to put up the dialog to pick the file. Rename/move or copy it to a fixed location. Import with a fixed import step. Rename/move it back, or delete it. (I depends how big the file is whether moving it back and forth is worth while. Unless it's quite big, it's easier to duplicate it to the fixed location in one step, then delete the duplicate afterwards.)

Posted

Interesting. It appears that if the setting is "All Available," and you import a .csv file, it will line up correctly. If you open the Import dialog afterwards you will see that it is set to "comma-separated." If you then choose a .tab file it will NOT import correctly at that setting; but it will if you change it back to "All available."

So it pays attention to the type of file for the import, if the setting is "All available," then it changes the setting to what that import was. Useful from a manual point of view, not so much from a scripting point of view. Because there is no option to knock it back to "All available" if it's currently something else without specifying a fixed file to import. The script step seems to also have that last setting by default.

I thought of a kludge to reset it with a script. Export (no dialog) a text file of the type you want, a very small file, 1 record, 1 field, with the file name and type set. Then import it. Delete the record.* Then run your other Import, with dialog. It should be set up correctly.

*If you choose the "first row is field names" option then it won't import a record, and it will change the import type. Sneaky B)-]

Or, on a Mac, use AppleScript to put up the dialog to pick the file. Rename/move or copy it to a fixed location. Import with a fixed import step. Rename/move it back, or delete it. (I depends how big the file is whether moving it back and forth is worth while. Unless it's quite big, it's easier to duplicate it to the fixed location in one step, then delete the duplicate afterwards.)

Posted

Great detective work!

Another question: do you think it is the presence of a comma in the first record that leads FM7 to pick CSV format when you choose "All available"? Or is it solely based on the file type?

Posted

Great detective work!

Another question: do you think it is the presence of a comma in the first record that leads FM7 to pick CSV format when you choose "All available"? Or is it solely based on the file type?

Posted

Great detective work!

Another question: do you think it is the presence of a comma in the first record that leads FM7 to pick CSV format when you choose "All available"? Or is it solely based on the file type?

Posted

Just a little experimenting on my system:

Imports "like" tab delimited:

abcdef,*tab*123*tab*aaaaaaaaaaaaaa

"abcdefg","123"*tab*aaaaaaaaaaaaaa

Imports "like" comma-delimited:

abcdef,*tab*123*tab*aaaaaaaaaaaaaa

"abcdefg","123",*tab*aaaaaaaaaaaaaa

Posted

Just a little experimenting on my system:

Imports "like" tab delimited:

abcdef,*tab*123*tab*aaaaaaaaaaaaaa

"abcdefg","123"*tab*aaaaaaaaaaaaaa

Imports "like" comma-delimited:

abcdef,*tab*123*tab*aaaaaaaaaaaaaa

"abcdefg","123",*tab*aaaaaaaaaaaaaa

Posted

Just a little experimenting on my system:

Imports "like" tab delimited:

abcdef,*tab*123*tab*aaaaaaaaaaaaaa

"abcdefg","123"*tab*aaaaaaaaaaaaaa

Imports "like" comma-delimited:

abcdef,*tab*123*tab*aaaaaaaaaaaaaa

"abcdefg","123",*tab*aaaaaaaaaaaaaa

Posted

changing from .txt to .dat seems to have no effect. What about giving the files a .tab extension and using fentons work around? It wont stop users from being able to import as "All Files (*.txt)" but it will at least default to the right file type - tab delimited.

Posted

changing from .txt to .dat seems to have no effect. What about giving the files a .tab extension and using fentons work around? It wont stop users from being able to import as "All Files (*.txt)" but it will at least default to the right file type - tab delimited.

Posted

changing from .txt to .dat seems to have no effect. What about giving the files a .tab extension and using fentons work around? It wont stop users from being able to import as "All Files (*.txt)" but it will at least default to the right file type - tab delimited.

  • 2 months later...
Posted

I thought of a kludge to reset it with a script. Export (no dialog) a text file of the type you want, a very small file, 1 record, 1 field, with the file name and type set. Then import it. Delete the record.* Then run your other Import, with dialog. It should be set up correctly.

*If you choose the "first row is field names" option then it won't import a record, and it will change the import type. Sneaky :-]

I like this, but can't get it to work generically -- if I use "file:Dummy_Export.tab" for the export file, for some reason the same file reference doesn't work for the import file. I'm doing this on a file hosted on FM7 server on mac. Any thoughts about how to script this so it works for all users, rather than hard-coding a path name? I wonder if I could use the ~ symbol to get to the home directory?

This topic is 7138 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.