imported file name

  • Permalink
  • submit to reddit
  • Email
  • Follow


I can't believe that we're at version 7.0 of FileMakerWannaBe, and STILL 
we can't capture the filename of an imported file. Surely I'm missing 
something.

I'm trying to import a file into a table, and need to set one of the 
fields to the name of the imported file. (The name of the imported file 
is already set to the specific string that I need it to be, plus .txt at 
the end.)

I've seen other recommendations regarding 3rd party plug ins, but I'm 
not shelling out yet more money just to handle the most rudimentary 
function that FileMaker can't do.

Obviously, the subgeniuses at FileMaker never read this newsgroup.

Can anyone manage this?

thanks.
0
Reply Bob 11/15/2004 12:56:53 AM

See related articles to this posting


Bob wrote:
> I can't believe that we're at version 7.0 of FileMakerWannaBe, and STILL 
> we can't capture the filename of an imported file. Surely I'm missing 
> something.

Well, which is it?  Is it that FileMaker 7 can't capture the filename or 
that you are missing something?

Have you tried setting a text field (or a calc) to 
getastext(ContainerField)?

> I'm trying to import a file into a table, and need to set one of the 
> fields to the name of the imported file. (The name of the imported file 
> is already set to the specific string that I need it to be, plus .txt at 
> the end.)

Or if you are importing a folder of files at a time, you will see the 
file name and path as two separate fields that can be imported along 
with the images or other type of files.

> Obviously, the subgeniuses at FileMaker never read this newsgroup.

Actually, that's not true.  I know that over time I have seen a couple 
different FMI engineers post here under their own names.  But more 
often, they post under assumed names to hide their identity.  And 
regardless of whether they post anything or not, I guarantee there is at 
least one FMI employee lurking silently to keep up with issues that are 
out there.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 883-2846
FM Pro Solutions       Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance
0
Reply Howard 11/15/2004 2:30:42 AM

> Have you tried setting a text field (or a calc) to 
> getastext(ContainerField)?

what does that mean? there IS no container field... I've seen others 
post the same advice, but what is that supposed to mean? even if I did 
have a container field, I'm importing a file into a series of 
records.... what is that supposed to mean?

 
> > I'm trying to import a file into a table, and need to set one of the 
> > fields to the name of the imported file. (The name of the imported file 
> > is already set to the specific string that I need it to be, plus .txt at 
> > the end.)


batch loading might be an idea, even if its only batch loading a single 
file... I'll look into it.
0
Reply Bob 11/15/2004 3:02:35 AM

> Or if you are importing a folder of files at a time, you will see the 
> file name and path as two separate fields that can be imported along 
> with the images or other type of files.


hm, I tried setting the import script function to act on a folder, and 
it let me set it up that way... but nothing gets imported. any one of 
those files imports just fine, but tring to import the folder does 
nothing.

still screwed, huh?

I'm only using filemaker here to prototype an application... the 
prototype shouldn't be harder to setup than the actual program.

come on, filemaker, implement variables... version 7, and still not a 
variable in sight?

sigh, it's shortcomings like this that have plagued filemaker since 
version 1.
0
Reply Bob 11/15/2004 4:05:11 AM

Bob wrote:
 > come on, filemaker, implement variables... version 7, and still not a
 > variable in sight?
 >
 > sigh, it's shortcomings like this that have plagued filemaker since
 > version 1.

If you would explain to us what on earth you are trying to do, perhaps 
someone could help you.  See answers below...

>>Have you tried setting a text field (or a calc) to 
>>getastext(ContainerField)?
> 
> what does that mean? there IS no container field... I've seen others 
> post the same advice, but what is that supposed to mean? even if I did 
> have a container field, I'm importing a file into a series of 
> records.... what is that supposed to mean?

Well if there is no container field, then what are you trying to import 
and to where are you trying to import it to?  Are you trying to import 
data from another file?  Or are you trying to store a file within a 
record as a blob?  Or...?  Don't you think that if others are posting 
the same advice, then maybe you're not properly explaining what you want 
to do?  You can blame FileMaker for a lot of things, but you can't blame 
it for your own ignorance.

>>Or if you are importing a folder of files at a time, you will see the 
>>file name and path as two separate fields that can be imported along 
>>with the images or other type of files.
> 
> hm, I tried setting the import script function to act on a folder, and 
> it let me set it up that way... but nothing gets imported. any one of 
> those files imports just fine, but tring to import the folder does 
> nothing.

When you import a folder, it is importing the files in that folder, each 
file into a separate record, into a container field.  Again, why would 
you want to only import the folder, and into what?  Is it data or some 
other kind of file or folder of files?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 883-2846
FM Pro Solutions       Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance
0
Reply Howard 11/15/2004 5:08:46 AM

> >>Have you tried setting a text field (or a calc) to 
> >>getastext(ContainerField)?
> > 
> > what does that mean? there IS no container field... I've seen others 
> > post the same advice, but what is that supposed to mean? even if I did 
> > have a container field, I'm importing a file into a series of 
> > records.... what is that supposed to mean?
> 
> Well if there is no container field, then what are you trying to import 
> and to where are you trying to import it to?  Are you trying to import 
> data from another file?  Or are you trying to store a file within a 
> record as a blob?  Or...?  Don't you think that if others are posting 
> the same advice, then maybe you're not properly explaining what you want 
> to do?  You can blame FileMaker for a lot of things, but you can't blame 
> it for your own ignorance.
> 
> >>Or if you are importing a folder of files at a time, you will see the 
> >>file name and path as two separate fields that can be imported along 
> >>with the images or other type of files.
> > 
> > hm, I tried setting the import script function to act on a folder, and 
> > it let me set it up that way... but nothing gets imported. any one of 
> > those files imports just fine, but tring to import the folder does 
> > nothing.
> 
> When you import a folder, it is importing the files in that folder, each 
> file into a separate record, into a container field.  Again, why would 
> you want to only import the folder, and into what?  Is it data or some 
> other kind of file or folder of files?
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Howard Schlossberg              (818) 883-2846


I'm trying to import a series of files, as that implies: import the 
columns of data in a text file into the database, one record per row, 
one field per column... just like import file does.

except, when importing from a folder, it stores the data info a 
container field... (that's not importing, it's storing, but whatever)... 
but I need that data imported into individual records, one per line, not 
one per file.

that approach did help, though, somewhat... except, I hit a dead end 
anyway:

importing the folders into a separate table I made for the job (e.g. 
fields: filename, filepath, somecontainer) does give me a good start by 
giving me a list of filepaths to programatically loop a file import 
script with...

except there's no way to feed a file path to the import function.

importing files one at a time (which is ok) provides no way to capture 
the file name, which must become a value in one of the target table's 
fields.

if I could affect an import scripts file path list, then I could stuff 
filepaths into it... but I can't.

or, if I could import records from a container field, then that would 
work. but I can't.

so any way around the problem, there's no wa to import a file and know 
its name (or do anything with it) at the same time.

filemaker has always had the potential to be the best database in the 
personal computer market, but it's always stopped just short of 
succeeding... this is only one such example.

it is the best database *tool* around, but it stops short of being a 
viable database *server*. that's a shame, it's really only a few 
oversights that stand in its way.

what's infuriating is the number of shortcomings that persist. this is 
my first peek at 7, and I was hoping all the hooplah of filemaker having 
addressed it's past issues held merit. but, I'm seeing all the usual 
suspects.
0
Reply Bob 11/15/2004 5:51:57 AM

Bob,

go to www.abstrakt.com and get the shell-plugin. It is free (donationware).
It allows you to execute shell commands like "DIR D:\" and returns the
result of the command into a field.

Furthermore, since it is a plug-in, it will not asynchroniously execute
shell commands (as the execute command script step of filemaker does where
you have to pause a script to make sure that the command HAS BEEN executed).

What you need to do:
execute a DIR on the Folder in question.
parse the result-field for the files you want.
RENAME/MOVE or RENAME/COPY the file(s) you want to import to a fixed
location.
At that location you can import it with filemakers impaired import
function(s).

Loop until all files are imported.

Regards, Wolf


"Bob" <bob@nowhere.com> schrieb im Newsbeitrag
news:bob-91DFBA.21515714112004@shawnews.gv.shawcable.net...
> > >>Have you tried setting a text field (or a calc) to
> > >>getastext(ContainerField)?
> > >
> > > what does that mean? there IS no container field... I've seen others
> > > post the same advice, but what is that supposed to mean? even if I did
> > > have a container field, I'm importing a file into a series of
> > > records.... what is that supposed to mean?
> >
> > Well if there is no container field, then what are you trying to import
> > and to where are you trying to import it to?  Are you trying to import
> > data from another file?  Or are you trying to store a file within a
> > record as a blob?  Or...?  Don't you think that if others are posting
> > the same advice, then maybe you're not properly explaining what you want
> > to do?  You can blame FileMaker for a lot of things, but you can't blame
> > it for your own ignorance.
> >
> > >>Or if you are importing a folder of files at a time, you will see the
> > >>file name and path as two separate fields that can be imported along
> > >>with the images or other type of files.
> > >
> > > hm, I tried setting the import script function to act on a folder, and
> > > it let me set it up that way... but nothing gets imported. any one of
> > > those files imports just fine, but tring to import the folder does
> > > nothing.
> >
> > When you import a folder, it is importing the files in that folder, each
> > file into a separate record, into a container field.  Again, why would
> > you want to only import the folder, and into what?  Is it data or some
> > other kind of file or folder of files?
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Howard Schlossberg              (818) 883-2846
>
>
> I'm trying to import a series of files, as that implies: import the
> columns of data in a text file into the database, one record per row,
> one field per column... just like import file does.
>
> except, when importing from a folder, it stores the data info a
> container field... (that's not importing, it's storing, but whatever)...
> but I need that data imported into individual records, one per line, not
> one per file.
>
> that approach did help, though, somewhat... except, I hit a dead end
> anyway:
>
> importing the folders into a separate table I made for the job (e.g.
> fields: filename, filepath, somecontainer) does give me a good start by
> giving me a list of filepaths to programatically loop a file import
> script with...
>
> except there's no way to feed a file path to the import function.
>
> importing files one at a time (which is ok) provides no way to capture
> the file name, which must become a value in one of the target table's
> fields.
>
> if I could affect an import scripts file path list, then I could stuff
> filepaths into it... but I can't.
>
> or, if I could import records from a container field, then that would
> work. but I can't.
>
> so any way around the problem, there's no wa to import a file and know
> its name (or do anything with it) at the same time.
>
> filemaker has always had the potential to be the best database in the
> personal computer market, but it's always stopped just short of
> succeeding... this is only one such example.
>
> it is the best database *tool* around, but it stops short of being a
> viable database *server*. that's a shame, it's really only a few
> oversights that stand in its way.
>
> what's infuriating is the number of shortcomings that persist. this is
> my first peek at 7, and I was hoping all the hooplah of filemaker having
> addressed it's past issues held merit. but, I'm seeing all the usual
> suspects.


0
Reply Wolf 11/15/2004 12:43:51 PM

hey, we might be almost there... I'm already able to collect the list of 
desired filenames (and paths) into a separate table... they're sitting 
in there as we speak, waiting for me to act on them.

here's the psuedo code for what I'm trying to make work... everything 
does except the dynamic import file step:



loop through list of filename/filepath records
  get filepath field from current record
  run import script with parameter(filepath)
end loop

begin import script
  -- here is where I get stuck
   import file( get(parameter) )
end import script



the question is: how do I command the import script step to import a 
specific file name? (I have the parameter passing working, I just don't 
know how to use that value within the import step.)


this is kind of critical to the prototype, of course.  ;o)  when isn't 
it.


thanks much guys and gals.
bob


In article <2vrmk3F2orrehU1@uni-berlin.de>,
 "Wolf Schwartz" <wolf@guerillaREMOVEMEsheepDOT.com> wrote:

> Bob,
> 
> go to www.abstrakt.com and get the shell-plugin. It is free (donationware).
> It allows you to execute shell commands like "DIR D:\" and returns the
> result of the command into a field.
> 
> Furthermore, since it is a plug-in, it will not asynchroniously execute
> shell commands (as the execute command script step of filemaker does where
> you have to pause a script to make sure that the command HAS BEEN executed).
> 
> What you need to do:
> execute a DIR on the Folder in question.
> parse the result-field for the files you want.
> RENAME/MOVE or RENAME/COPY the file(s) you want to import to a fixed
> location.
> At that location you can import it with filemakers impaired import
> function(s).
> 
> Loop until all files are imported.
> 
> Regards, Wolf
> 
> 
> "Bob" <bob@nowhere.com> schrieb im Newsbeitrag
> news:bob-91DFBA.21515714112004@shawnews.gv.shawcable.net...
> > > >>Have you tried setting a text field (or a calc) to
> > > >>getastext(ContainerField)?
> > > >
> > > > what does that mean? there IS no container field... I've seen others
> > > > post the same advice, but what is that supposed to mean? even if I did
> > > > have a container field, I'm importing a file into a series of
> > > > records.... what is that supposed to mean?
> > >
> > > Well if there is no container field, then what are you trying to import
> > > and to where are you trying to import it to?  Are you trying to import
> > > data from another file?  Or are you trying to store a file within a
> > > record as a blob?  Or...?  Don't you think that if others are posting
> > > the same advice, then maybe you're not properly explaining what you want
> > > to do?  You can blame FileMaker for a lot of things, but you can't blame
> > > it for your own ignorance.
> > >
> > > >>Or if you are importing a folder of files at a time, you will see the
> > > >>file name and path as two separate fields that can be imported along
> > > >>with the images or other type of files.
> > > >
> > > > hm, I tried setting the import script function to act on a folder, and
> > > > it let me set it up that way... but nothing gets imported. any one of
> > > > those files imports just fine, but tring to import the folder does
> > > > nothing.
> > >
> > > When you import a folder, it is importing the files in that folder, each
> > > file into a separate record, into a container field.  Again, why would
> > > you want to only import the folder, and into what?  Is it data or some
> > > other kind of file or folder of files?
> > >
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > Howard Schlossberg              (818) 883-2846
> >
> >
> > I'm trying to import a series of files, as that implies: import the
> > columns of data in a text file into the database, one record per row,
> > one field per column... just like import file does.
> >
> > except, when importing from a folder, it stores the data info a
> > container field... (that's not importing, it's storing, but whatever)...
> > but I need that data imported into individual records, one per line, not
> > one per file.
> >
> > that approach did help, though, somewhat... except, I hit a dead end
> > anyway:
> >
> > importing the folders into a separate table I made for the job (e.g.
> > fields: filename, filepath, somecontainer) does give me a good start by
> > giving me a list of filepaths to programatically loop a file import
> > script with...
> >
> > except there's no way to feed a file path to the import function.
> >
> > importing files one at a time (which is ok) provides no way to capture
> > the file name, which must become a value in one of the target table's
> > fields.
> >
> > if I could affect an import scripts file path list, then I could stuff
> > filepaths into it... but I can't.
> >
> > or, if I could import records from a container field, then that would
> > work. but I can't.
> >
> > so any way around the problem, there's no wa to import a file and know
> > its name (or do anything with it) at the same time.
> >
> > filemaker has always had the potential to be the best database in the
> > personal computer market, but it's always stopped just short of
> > succeeding... this is only one such example.
> >
> > it is the best database *tool* around, but it stops short of being a
> > viable database *server*. that's a shame, it's really only a few
> > oversights that stand in its way.
> >
> > what's infuriating is the number of shortcomings that persist. this is
> > my first peek at 7, and I was hoping all the hooplah of filemaker having
> > addressed it's past issues held merit. but, I'm seeing all the usual
> > suspects.
> 
>
0
Reply Bob 11/15/2004 6:43:35 PM

Hi Bob,

you set up the import step by giving it a file reference (relative/absolute
location)
I think the script step is import records and you can run it without dialog
if you set up the file reference to it.

Thats why you need a rename/copy script step before (using the shell
extension), so your file is at a "always known location"
You can use the shell plugin after the import to delete the file.


Probably the best approach is to use a relative path file, since you can set
up a temp folder in your solution and do this without cluttering your
solution files.

So the sequence of events is:

1. You have a list of filenames (full path preferably)

2. Loop through the list and do:

a. rename/copy file to a known location (You can get your solutions file
path by using and tampering with the Get() function)
SHELL: "Copy " & quote(field::sourcefile) & " " & quote(field::destfile)
You need the quotes if there are spaces in the filepath/name!

b. import records with no dialog (file reference is set to the renamed file)
c. loop until end of list
d. delete the last import file (the previous ones are overwritten.. i havent
tested this with the shell plugin, if it doesnt overwrite you need a "delete
the imported file" step after importing inside the loop)

You dont need a parameter passing as the import records step doesn't accept
a variable.

Come any clearer yet :) ?

Regards, Wolf

"Bob" <bob@nowhere.com> schrieb im Newsbeitrag
news:bob-39142A.10433515112004@shawnews.gv.shawcable.net...
> hey, we might be almost there... I'm already able to collect the list of
> desired filenames (and paths) into a separate table... they're sitting
> in there as we speak, waiting for me to act on them.
>
> here's the psuedo code for what I'm trying to make work... everything
> does except the dynamic import file step:
>
>
>
> loop through list of filename/filepath records
>   get filepath field from current record
>   run import script with parameter(filepath)
> end loop
>
> begin import script
>   -- here is where I get stuck
>    import file( get(parameter) )
> end import script
>
>
>
> the question is: how do I command the import script step to import a
> specific file name? (I have the parameter passing working, I just don't
> know how to use that value within the import step.)
>
>
> this is kind of critical to the prototype, of course.  ;o)  when isn't
> it.
>
>
> thanks much guys and gals.
> bob
>
>
> In article <2vrmk3F2orrehU1@uni-berlin.de>,
>  "Wolf Schwartz" <wolf@guerillaREMOVEMEsheepDOT.com> wrote:
>
> > Bob,
> >
> > go to www.abstrakt.com and get the shell-plugin. It is free
(donationware).
> > It allows you to execute shell commands like "DIR D:\" and returns the
> > result of the command into a field.
> >
> > Furthermore, since it is a plug-in, it will not asynchroniously execute
> > shell commands (as the execute command script step of filemaker does
where
> > you have to pause a script to make sure that the command HAS BEEN
executed).
> >
> > What you need to do:
> > execute a DIR on the Folder in question.
> > parse the result-field for the files you want.
> > RENAME/MOVE or RENAME/COPY the file(s) you want to import to a fixed
> > location.
> > At that location you can import it with filemakers impaired import
> > function(s).
> >
> > Loop until all files are imported.
> >
> > Regards, Wolf
> >
> >
> > "Bob" <bob@nowhere.com> schrieb im Newsbeitrag
> > news:bob-91DFBA.21515714112004@shawnews.gv.shawcable.net...
> > > > >>Have you tried setting a text field (or a calc) to
> > > > >>getastext(ContainerField)?
> > > > >
> > > > > what does that mean? there IS no container field... I've seen
others
> > > > > post the same advice, but what is that supposed to mean? even if I
did
> > > > > have a container field, I'm importing a file into a series of
> > > > > records.... what is that supposed to mean?
> > > >
> > > > Well if there is no container field, then what are you trying to
import
> > > > and to where are you trying to import it to?  Are you trying to
import
> > > > data from another file?  Or are you trying to store a file within a
> > > > record as a blob?  Or...?  Don't you think that if others are
posting
> > > > the same advice, then maybe you're not properly explaining what you
want
> > > > to do?  You can blame FileMaker for a lot of things, but you can't
blame
> > > > it for your own ignorance.
> > > >
> > > > >>Or if you are importing a folder of files at a time, you will see
the
> > > > >>file name and path as two separate fields that can be imported
along
> > > > >>with the images or other type of files.
> > > > >
> > > > > hm, I tried setting the import script function to act on a folder,
and
> > > > > it let me set it up that way... but nothing gets imported. any one
of
> > > > > those files imports just fine, but tring to import the folder does
> > > > > nothing.
> > > >
> > > > When you import a folder, it is importing the files in that folder,
each
> > > > file into a separate record, into a container field.  Again, why
would
> > > > you want to only import the folder, and into what?  Is it data or
some
> > > > other kind of file or folder of files?
> > > >
> > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > Howard Schlossberg              (818) 883-2846
> > >
> > >
> > > I'm trying to import a series of files, as that implies: import the
> > > columns of data in a text file into the database, one record per row,
> > > one field per column... just like import file does.
> > >
> > > except, when importing from a folder, it stores the data info a
> > > container field... (that's not importing, it's storing, but
whatever)...
> > > but I need that data imported into individual records, one per line,
not
> > > one per file.
> > >
> > > that approach did help, though, somewhat... except, I hit a dead end
> > > anyway:
> > >
> > > importing the folders into a separate table I made for the job (e.g.
> > > fields: filename, filepath, somecontainer) does give me a good start
by
> > > giving me a list of filepaths to programatically loop a file import
> > > script with...
> > >
> > > except there's no way to feed a file path to the import function.
> > >
> > > importing files one at a time (which is ok) provides no way to capture
> > > the file name, which must become a value in one of the target table's
> > > fields.
> > >
> > > if I could affect an import scripts file path list, then I could stuff
> > > filepaths into it... but I can't.
> > >
> > > or, if I could import records from a container field, then that would
> > > work. but I can't.
> > >
> > > so any way around the problem, there's no wa to import a file and know
> > > its name (or do anything with it) at the same time.
> > >
> > > filemaker has always had the potential to be the best database in the
> > > personal computer market, but it's always stopped just short of
> > > succeeding... this is only one such example.
> > >
> > > it is the best database *tool* around, but it stops short of being a
> > > viable database *server*. that's a shame, it's really only a few
> > > oversights that stand in its way.
> > >
> > > what's infuriating is the number of shortcomings that persist. this is
> > > my first peek at 7, and I was hoping all the hooplah of filemaker
having
> > > addressed it's past issues held merit. but, I'm seeing all the usual
> > > suspects.
> >
> >


0
Reply Wolf 11/16/2004 12:44:11 PM

yes, I see your approach now.

this is considered elegant, filemaker? and even this needs an external 
plug in.

thanks wolf, I wouldn't have figured out such a convoluted way around 
the problem. at least this can work.

bob


In article <2vub0sF2pjnrqU1@uni-berlin.de>,
 "Wolf Schwartz" <wolf@guerillaREMOVEMEsheepDOT.com> wrote:

> Hi Bob,
> 
> you set up the import step by giving it a file reference (relative/absolute
> location)
> I think the script step is import records and you can run it without dialog
> if you set up the file reference to it.
> 
> Thats why you need a rename/copy script step before (using the shell
> extension), so your file is at a "always known location"
> You can use the shell plugin after the import to delete the file.
> 
> 
> Probably the best approach is to use a relative path file, since you can set
> up a temp folder in your solution and do this without cluttering your
> solution files.
> 
> So the sequence of events is:
> 
> 1. You have a list of filenames (full path preferably)
> 
> 2. Loop through the list and do:
> 
> a. rename/copy file to a known location (You can get your solutions file
> path by using and tampering with the Get() function)
> SHELL: "Copy " & quote(field::sourcefile) & " " & quote(field::destfile)
> You need the quotes if there are spaces in the filepath/name!
> 
> b. import records with no dialog (file reference is set to the renamed file)
> c. loop until end of list
> d. delete the last import file (the previous ones are overwritten.. i havent
> tested this with the shell plugin, if it doesnt overwrite you need a "delete
> the imported file" step after importing inside the loop)
> 
> You dont need a parameter passing as the import records step doesn't accept
> a variable.
> 
> Come any clearer yet :) ?
> 
> Regards, Wolf
0
Reply Bob 11/16/2004 6:28:52 PM

It can be done without plug-ins, but it gets even a little
more convoluted.  You could use the Send Message step to call a DOS 
command: "cmd /c dir >directory.txt" and then import the resulting text 
file into an FMP table to loop through and grab the info you want.

Bob wrote:
> yes, I see your approach now.
> 
> this is considered elegant, filemaker? and even this needs an external 
> plug in.
> 
> thanks wolf, I wouldn't have figured out such a convoluted way around 
> the problem. at least this can work.
> 
> bob
> 
> 
> In article <2vub0sF2pjnrqU1@uni-berlin.de>,
>  "Wolf Schwartz" <wolf@guerillaREMOVEMEsheepDOT.com> wrote:
> 
> 
>>Hi Bob,
>>
>>you set up the import step by giving it a file reference (relative/absolute
>>location)
>>I think the script step is import records and you can run it without dialog
>>if you set up the file reference to it.
>>
>>Thats why you need a rename/copy script step before (using the shell
>>extension), so your file is at a "always known location"
>>You can use the shell plugin after the import to delete the file.
>>
>>
>>Probably the best approach is to use a relative path file, since you can set
>>up a temp folder in your solution and do this without cluttering your
>>solution files.
>>
>>So the sequence of events is:
>>
>>1. You have a list of filenames (full path preferably)
>>
>>2. Loop through the list and do:
>>
>>a. rename/copy file to a known location (You can get your solutions file
>>path by using and tampering with the Get() function)
>>SHELL: "Copy " & quote(field::sourcefile) & " " & quote(field::destfile)
>>You need the quotes if there are spaces in the filepath/name!
>>
>>b. import records with no dialog (file reference is set to the renamed file)
>>c. loop until end of list
>>d. delete the last import file (the previous ones are overwritten.. i havent
>>tested this with the shell plugin, if it doesnt overwrite you need a "delete
>>the imported file" step after importing inside the loop)
>>
>>You dont need a parameter passing as the import records step doesn't accept
>>a variable.
>>
>>Come any clearer yet :) ?
>>
>>Regards, Wolf

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg              (818) 883-2846
FM Pro Solutions       Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance
0
Reply Howard 11/16/2004 7:10:13 PM

Hi Howard, hi Bob,

Yup, i know.
Doing that has the added convolutedness that send message commands are
executed asynchronously.. meaning filemaker sends the command and then
immediately goes on with the script.
In the USUAL circumstance that you send a DIR command to >file.txt, you
cannot immediately afterwards in your script ASSUME that the file has been
created and/or created and filled with the data. (Well, maybe on a pentium
I, 33mhz :)
You must pause the script at least for two seconds to allow for completion
of the send message command DIR ... on a decently large directory of say
100-300 files. (Given a 2mhz P4 or something like that)
Now if you wanna script THAT  impairment out of the script... even more
convolutions.
So the approach with the shell plugin does take out a lot of hassles, since
execution of the script continues when the shell command has completed.
(Having been through all of this by trial and error myself, I do have some
firsthand experience... unfortunately)

I finally arrived at a solution where i have a separate "parsing file" that
executes and then chews on the result of the shell command and returns a
value list or "OK" or whatever i've told it to. That way i can at least
simply reuse that file in other solutions. I call specific scripts in the
parsing file, giving it a calculated script parameter. Then I pull out the
digested data from a global or a table.

I do understand that doing things like the above is beyond the scope of
filemaker, but why they are using their fixed file reference model (which
has its merits in keeping a solution "together") in their importing steps
instead of (or additionally) allowing the passing of a path/file (or dialog)
is completely beyond my understanding.

hm..., i hope now i didnt sound too convoluted :p
Regards, Wolf


"Howard Schlossberg" <howard@antispahm.fmprosolutions.com> schrieb im
Newsbeitrag news:10pkk55a9u3vn6b@corp.supernews.com...
> It can be done without plug-ins, but it gets even a little
> more convoluted.  You could use the Send Message step to call a DOS
> command: "cmd /c dir >directory.txt" and then import the resulting text
> file into an FMP table to loop through and grab the info you want.
>
> Bob wrote:
> > yes, I see your approach now.
> >
> > this is considered elegant, filemaker? and even this needs an external
> > plug in.
> >
> > thanks wolf, I wouldn't have figured out such a convoluted way around
> > the problem. at least this can work.
> >
> > bob
> >
> >
> > In article <2vub0sF2pjnrqU1@uni-berlin.de>,
> >  "Wolf Schwartz" <wolf@guerillaREMOVEMEsheepDOT.com> wrote:
> >
> >
> >>Hi Bob,
> >>
> >>you set up the import step by giving it a file reference
(relative/absolute
> >>location)
> >>I think the script step is import records and you can run it without
dialog
> >>if you set up the file reference to it.
> >>
> >>Thats why you need a rename/copy script step before (using the shell
> >>extension), so your file is at a "always known location"
> >>You can use the shell plugin after the import to delete the file.
> >>
> >>
> >>Probably the best approach is to use a relative path file, since you can
set
> >>up a temp folder in your solution and do this without cluttering your
> >>solution files.
> >>
> >>So the sequence of events is:
> >>
> >>1. You have a list of filenames (full path preferably)
> >>
> >>2. Loop through the list and do:
> >>
> >>a. rename/copy file to a known location (You can get your solutions file
> >>path by using and tampering with the Get() function)
> >>SHELL: "Copy " & quote(field::sourcefile) & " " & quote(field::destfile)
> >>You need the quotes if there are spaces in the filepath/name!
> >>
> >>b. import records with no dialog (file reference is set to the renamed
file)
> >>c. loop until end of list
> >>d. delete the last import file (the previous ones are overwritten.. i
havent
> >>tested this with the shell plugin, if it doesnt overwrite you need a
"delete
> >>the imported file" step after importing inside the loop)
> >>
> >>You dont need a parameter passing as the import records step doesn't
accept
> >>a variable.
> >>
> >>Come any clearer yet :) ?
> >>
> >>Regards, Wolf
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Howard Schlossberg              (818) 883-2846
> FM Pro Solutions       Los Angeles, California
>
> FileMaker 7 Certified Developer
> Associate Member, FileMaker Solutions Alliance


0
Reply Wolf 11/17/2004 1:44:39 AM

wo... ok, i'm with you from a strategy perspective, but the 
record/filename looping code... my mind is mush at the moment, please 
forgive the newbie question.

anyone help me with the obvious here?

thanks,
b
0
Reply Bob 11/17/2004 4:20:06 AM

Hi bob,

sure. No problem. Lets start with the obvious, shall we?

1. You do need the shell plugin.
2. I assume the files you want to import can be placed at a fixed/known
location?
Like a special desktop folder or a "import_me" folder that resides in your
solution folder?
If it is a fixed location (hard coded path) i would still suggest you set up
a variable for maintenance reasons.
If it is a relative path to your solution, you can have filemaker calculate
it. Below is a calculation for a relative path:

field g_ImportFolder(Text)
field g_ImportPath(Calculation, Text) =
Substitute( Get(FilePath) & g_ImportFolder;
["file:/";""];[".fp7";""];[Get(FileName);""];["/";"\\"] )

Enter: "ImportFiles/" into g_importfolder (or nothing if you place your
import files into the solution folder)

Result of this would be like: "D:\fp7files\mysolution\ImportFiles\"

Please note, as we're using DOS command(s), we need "\" instead of "/" so
the calculation replaces them.
Also note that "\" is a filemaker "escape" character so \\ in the substitute
equates to \

Ok, now we're basically set up for the shell command to work its magic

field g_command = text
field g_result = text

enter
g_command = "DIR " & Quote(g_ImportPath)

Script:
Name "Execute" has 1 step:

Set Field [g_result; External( "shell-Execute"; Evaluate(g_command) ) ]

Run the script and if your import folder doesnt exist, you'll get an error
message, else you get a listing


You with me this far ?


Cheers, Wolf


"Bob" <bob@nowhere.com> schrieb im Newsbeitrag
news:bob-FEDCDC.20200616112004@shawnews.gv.shawcable.net...
> wo... ok, i'm with you from a strategy perspective, but the
> record/filename looping code... my mind is mush at the moment, please
> forgive the newbie question.
>
> anyone help me with the obvious here?
>
> thanks,
> b


0
Reply Wolf 11/17/2004 1:44:08 PM

> Ok, now we're basically set up for the shell command to work its magic
> 
> field g_command = text
> field g_result = text
> 
> enter
> g_command = "DIR " & Quote(g_ImportPath)
> 
> Script:
> Name "Execute" has 1 step:
> 
> Set Field [g_result; External( "shell-Execute"; Evaluate(g_command) ) ]
> 
> Run the script and if your import folder doesnt exist, you'll get an error
> message, else you get a listing
> 
> 
> You with me this far ?
> 
> 
> Cheers, Wolf

if I'm reading this correctly, you're stuffing a directory list into a 
table, one record per filename/pathname... that I already have done.

it's the rest I was looking for. please go on.


I need a dumb question answered, but I can't find the answer anyuwhere

re: filemaker 7, find requests... how do I reference a field in a find 
request. e.g.

thistable::topic == categories::g_category



thanks,
B
0
Reply Bob 11/18/2004 10:10:13 PM
comp.databases.filemaker 10774 articles. 18 followers. Post

14 Replies
423 Views

Similar Articles

[PageSpeed] 2


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

how to know the importing file name from an imported file?
Hi Is there a way to know the name of the script(say A), which is importing a module(say B), from B? ie in above situation i should be able to get name 'A' through some way in B, when A contains an 'import B' statement. -- Thanks & Regards visco Visco Shaun wrote: > Is there a way to know the name of the script(say A), which is importing > a module(say B), from B? > ie in above situation i should be able to get name 'A' through some way > in B, when A contains an 'import B' statement. While import sys print "I'm imported by %r&quo...

Automate Import of File with Certain Text in File Name
Dear Access Developers: I need to automatically import a file into Access from the same directory every day. However, I need the code to search the files in the directory and only import the one with the current day's date in the file name (otherwise, the file name will not change). Alternatively, Access could just import the one with the most recent save date. Can anyone provide code to do this? Thank you. JG Scott G'Day, I found this code some time ago, it grabs all the filenames in a directory. You can use it in a standard module, and bring all the filenames back to a variab...

Importing by file name
As part of a post on python-ideas, I wanted to knock together a quick little script that "imports" a file based on its name, in the same way that the Python interpreter will happily take an absolute pathname for the main script. I'm sure there's a way to do it, but I don't know how. Obviously the import statement can't do it, but I've been poking around with __import__ and importlib without success. (Experiments are being done on Python 3.3; if a different version would make the job easier I'm happy to switch. This is just a curiosity tinkering.) Her...

importing multiple csv files at one, and creating a new column taking characters from the csv file name
Hi; I am trying import a bunch of datasets, with the same format and extension .csv. They are saved in the same folder, and all named the same way, for instance: Week_JULY21_3456. So I want to import them all, append them, and create a new column id that corresponds to the last 4 characters of each file name. The columns that each csv file has is Obs Datetime x y z where obs is a number with no decimals, datetime is in datetime format, and x, y,z are number with decimals. Besides those column, there will be a new column ID, which will be the 4 last numbers of the csv f...

Can I construct this process in SAS session (unzip csv files,import,name dataset if and delete upzipped files) ?
Hi, Can I do this in SAS? 1.Unzip a zip file (containing various delimited .csv files) 2.Import the files into SAS. 3.Name the dataset depending on if the file name contains 'xxx' 4.delete the .csv files after importing Apologies in advance as I am not very experienced with loops and arrays if that is what's needed. Thanks Lee "SAS User" <sasuser2010@googlemail.com> wrote in message news:ec00a638-4f85-4d1e-8a9a-6a0db42ddf07@c33g2000yqm.googlegroups.com... > Hi, > > Can I do this in SAS? > > 1.Unzip a zip file (containing various delimited .csv...

Importing files with similar name
Hi, I am trying to read some images on matlab and convert them to matrices. The problem is I have a lot of images to convert and all of them have a similar name: c=imread('/Users/nl/Desktop/Videos09/GroupA/Video/images/image-001','JPG'); c=imread('/Users/nl/Desktop/Videos09/GroupA/Video/images/image-002','JPG'); .... and so on. The only thing that changes is the last character. Is it possible to do a for changing only the last character of the filename so that I can do this automatically? Regards, Nuno On Nov 20, 5:38=A0am, "Nuno Loureiro&q...

How to Capture Import File Name
When I import records from a file, eg a csv, I'd like to capture the file name and or path of the source and store it in a field. I've looked through the "Get" functions and don't see anything applicable. Any ideas as to how I can automate this? -- Nelson On Sun, 30 Mar 2014 11:26:24 -0400, Nelson wrote (in article <0001HW.CF5DAFE0000403B9B02919BF@news.astraweb.com>): > When I import records from a file, eg a csv, I'd like to capture the > file name and or path of the source and store it in a field. I've > looked through th...

Is name/path of init file important?
I usually start emacs as "emacs -l ~/.emacs/.emacs". I'd like to start with the *scratch* buffer in text-mode. So I added the following 2 lines to my init file: (setq default-major-mode 'text-mode) (setq initial-major-mode 'text-mode) But this is being ignored, and my *scratch* buffer remains in Lisp Interaction mode. The other initializations seem to have been honoured, though. Now when I copy my .emacs file to ~/.emacs file (after renaming my ..emacs directory to something else), I start in Text mode as I wanted. Could someone please explain why the initial-major-m...

How to Import All Named Ranges From an Excel File
As the title states, I am trying to figure out how to import all named ranges from an Excel file. A guy named Phil was helping me with this. I still can't get it working. I had the code importing one single named range, but NOT ALL named ranges. This is what I have for code now. function MATLABValue = GetNamedRangeFromExcel(RangeName, ExcelFile) %GETNAMEDRANGEFROMEXCEL Retrieve a named range from an Excel workbook % This function allow the user to retrieve a named range of cells inside % a MATLAB variable % % Inputs: % RangeName is the name of the Excel range ("named rang...

import variable names from delimited files
Hi- I have a bunch of dollar delimited files for conversion to SAS datasets. I've written a small macro code using Proc import with guessing rows=1000 (needed as some colums have a lot of numerical data with few character values). It works fine, only issue is that occasionaly a couple of files are empty (i.e they have column headers but no data values). In such a case, I still want empty SAS datasets to be created giving the variable names. However if there are no datavalues, SAS gives an error such as this: "Unable to sample external file, no data in first 5 records." Thanks ...

Importing files that are generated with different names
I am trying to import files that start the same but are sequencial. For instance ABC123, ABC124 from C:\FOLDERNAME. These are .dbf files that are created from a Foxpro program. I would like all the new files be imported into one table and the file name to be inserted into the table. What I have now is not importing any files. Any help to review this would be greatly appreciated. Or is there a better way? Thanks in advance. Private Sub Command7_Click() On Error GoTo ErrHandler Dim oFSystem As Object Dim oFolder As Object Dim oFile As Object Dim sFolderPath As String Dim SQL A...

Import Excel file which has Dynamic name
Hi All, I have an Excel file being delivered to a shared drive where I only have read access on a daily basis. The files arrive in the following format 'Filename+timestamp.xls' Example: ThisFile2007-02-01 11.02.00.421.xls Is there a way a can create some sort of link that matches a pattern? If file name starts with 'ThisFile' Import data Thanks all Steve Steve wrote: > Hi All, > I have an Excel file being delivered to a shared drive where I only > have read access on a daily basis. > > The files arrive in the following format 'Filename+timestamp.xls...

How do you import an .ABA file to names.nsf?
I can't afford the software that will allow me to synch my Sony Clie with Notes, but I can export my Clie address book to the Standard .ABA format - does anyone have an agent that would know how to separate the infomation out into separate entries with the values in the correct fields? ...

Import dynamically named files using macro
I have a database set-up to do file comparisons. I import the files into the database and do the comparisons with queries. I have to do this comparison on a daily basis so I would like to set up a macro to do it. The problem I have is that the names of the source files that are imported change everyday. The date is appended to the file name. The format of the file name is 'filename mm-dd-yyyy.txt'. Is there a way to write a macro to import files when the name of the source file changes everyday? On Tue, 11 May 2004 10:01:36 -0400, "Jeff Marcum" <jeffmarcum@consult...

import delimited file specifying field names
I have a pipe delimited, quote surround file, no header, unknown field lengths, to import to SAS. The following code gives me everything but the variable names. How can I specify these as well, without having to add field names to the raw file? PROC IMPORT OUT= <Libname>.<DataSetName> DATAFILE= "<FilePath>.<FileName>" DBMS=DLM REPLACE; DELIMITER='7C'x; GETNAMES=NO; DATAROW=1; RUN; I HAVE noticed that SAS converts this to a data step, adding format, informat and input statements. I know that I could add the correct field ...

View list of file names, select for import
Hi all, what's your recommendation to get a list of filenames within a directory? It's an import problem with a Windows network where hundreds of files are listed within a certain directory, such as X:\importpath\hugefolder\ I want a list of all files within this directory, including its creation date, file size and file name. On the Mac I would just start a proper shell script and import this result. Then I could mark all matching files (which were already imported before) and present a list of files which were not yet imported. The user should choose one of those files and a...

How to import ALL named ranges from an Excel file into Matlab?
I'm trying to find a way to import ALL NAMED RANGES from an Excel file into Matlab. The function below seems to work fine for ONE SINGLE NAMED RANGE. How can I import ALL NAMED RANGES? function MATLABValue = GetNamedRangeFromExcel(RangeName, ExcelFile) %GETNAMEDRANGEFROMEXCEL Retrieve a named range from an Excel workbook % This function allow the user to retrieve a named range of cells inside % a MATLAB variable % % Inputs: % RangeName is the name of the Excel range ("named range") we want to % retrieve in teh workbook % % ExcelFile is the ...

How to import a standard module in source file with same name?
Here is my situation. To add more functionalities to a standard library(datetime) in python, I am implementing my own code called vp.datetime (directory structure, vp/datetime.py). To make it clear the file extends functions of the standard datetime, I like to use the same name with its standard library. The problem is that I have to use the standard library inside my extended code. But, whenever I try "import datetime", it assumes my extended module, not the standard module because of python's default path searching order. Under the condition that the absolute path to the sta...

Getting the name of the file that imported current module
foo.py: import bar bar.show_importer() output: 'foo' or 'foo.py' or 'path/to/foo' etc. Possible? Thanks, Tobiah On 04/07/2010 22:05, Tobiah wrote: > foo.py: > > import bar > bar.show_importer() > > output: > > 'foo' or 'foo.py' or 'path/to/foo' etc. > > Possible? > > Thanks, > > Tobiah >>> import re >>> re.__file__ 'C:\\Python26\\lib\\re.pyc' HTH. Mark Lawrence. On 07/04/2010 03:17 PM, Mark Lawrence wrote: > On 04/07/2010 22...

Re: import variable names from delimited files
A.K. Lee wrote: > I have a bunch of dollar delimited files for conversion to SAS datasets. > I've written a small macro code using Proc import with guessing rows=1000 > (needed as some colums have a lot of numerical data with few character > values). It works fine, only issue is that occasionaly a couple of files > are empty (i.e they have column headers but no data values). > > In such a case, I still want empty SAS datasets to be created giving the > variable names. However if there are no datavalues, SAS gives an error such > as this: "Unable to sample ...

how to I include the imported file name aswell as data?
Hi, Could someone please assist me by showing me how to include the name of the log file against each record imported. filename logfile "c:\temp\logs\*.log"; data work.log_temp; length line $20; infile logfile truncover delimiter='||'; input line; run; Thanks Lee On Tuesday, May 8, 2012 12:06:50 PM UTC-7, Lee wrote: > Hi, > > Could someone please assist me by showing me how to include the name > of the log file against each record imported. > > filename logfile "c:\temp\logs\*.log"; > data work.log_temp; > length line $20; > infile l...

Import module with non-standard file name
Howdy all, Question: I have Python modules named without '.py' as the extension, and I'd like to be able to import them. How can I do that? Background: On Unix, I write programs intended to be run as commands to a file with no extension. This allows other programs to use the command as an interface, and I can re-write the program in some other language without obsoleting the commandline interface. e.g., I might write 'frobnicate-foo' as a shell program so that other programs can 'frobnicate-foo --bar baz'. If I later decide to re-implement 'frobnicate-foo...

Importing a text file with a partially unknown name
I need to import a file into Access 2013 that has the naming convention of RACV_YYYYMMDDhhmmss.out. In the past there were no hours, minutes, and seconds so I have always been able to tell it to import the file by using this code: DataImport "M:\Folder1\Folder2\Download\Backup\RACV_" & Format(Date, "yyyymmdd") & ".out", "tblname", "FileImportSpec" I know that the file will have today's date, but I will not know the hours, minutes, and seconds of the exact time the file was created. How do I search for the file first, and then...

Re: set variable name when import excel file
You didn't mention which method you are using to import EXCEL sheet, is that using import wizard?, I am assuming it is then you can uncheck the firstrow variable options in the options window. Using DDE you can specify the variable names the way you want and start reading the data what ever location you want from the sheet. Specifying variables in a particular row may not be allowed using PROC IMPORT which is also used behind the scenes of import wizard. May be you can try EFI which has more flexibility. Prasad Ravi "Yang, Kai" ...