Jump to content

can I import a tab delin text file via script?


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

Recommended Posts

Can I import a text file via the Import Records script step?

So far I don't see how I calculate the filename I am going to import.

I have a file, I know where it is, its path is stored in a global variable, I even copied the record into a variable but when I enter filemac:/$g_variableName in the file area FileMaker Pro complains:

The file "g_variableName" could not be found and is required to complete this operation

Is this possible?

Link to comment
Share on other sites

You say "global variable", but your $variable above is local, not $$global. So it will only work if the variable was set within that script. Another thing to check is whether the file path already has the 1st / (slash); most of the FileMaker calculation functions do: Get (DesktopPath), etc.. Use the Data Viewer to see what the Variable is before exporting. Is it a full path, from the root? It doesn't take much for a file path to be wrong.

Link to comment
Share on other sites

Thank you for the replies. My problem was twofold: I wasn't including the filemac:/ in my variable definition and also the stored path I had was HFS so I needed to convert the colons to slashes.

Set Variable [$$g_pathToFileFile; Value: "filemac:/" & Substitute ( LineItems::g_pathToFileFile ; ":" ; "/" )

Thanks!

Link to comment
Share on other sites

This topic is 5772 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
 Share

×
×
  • Create New...

Important Information

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