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 10777 articles. 18 followers. Post

14 Replies
435 Views

Similar Articles

[PageSpeed] 4


  • 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...

output file name based on original file name
I have a simple txt parsing script that I'd like to have the output be named after the original text file. original = original.txt output = original_output.txt I'm just doing a simple file.open, and couldn't find anything. File.open('output.txt', 'w') do |f2| File.readlines("original.txt").each do |line| Thanks in advance for any help. -- Posted via http://www.ruby-forum.com/. Collin Moore wrote: > I have a simple txt parsing script that I'd like to have the output be > named after the original text file. > > original = original.tx...

automatic naming of files based on the readed file name?
Using "write labview measurement file" and "read labview measurement file". For example: Readed_file.dat Readed_file_written.dat ...

How to pass NCDF files name to text files names?
Folks I am reading some NCDF files like this: pathName=3D"d:\p\" List =3D findfile(pathName+"*.nc") nosFiles=3DN_ELEMENTS(List) data =3D ptrarr(nosFiles) for i =3D 0, nosFiles - 1 do begin ncid =3D NCDF_OPEN(list[i]) NCDF_VARGET, ncid, 0, lon NCDF_VARGET, ncid, 1, lat NCDF_VARGET, ncid, 2, concentration NCDF_CLOSE, ncid ; Close the NetCDF file *Here I need to save all of my files (in text format) in arrays with 3 columns and with name of NCDF file that I am reading (for instance: L3b_20070716.txt, L3b_20070717 and so on)* Endfor In another word I need to pass my NCD...

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...

How to copy a file to a file with a prefixed file name
I'm trying to write a program that will archive selected files to an archive directory. The files in the archive directory will have a prefix in the format yyyymmdd-hhmmss-filename.ext. So, if the file is called "somefile.dat", then the filename in the archive directory should be "20090522-164325-somefile.dat". I'm using Clipper's COPY FILE command to do the copy. I can't figure out how to get the prefix in front of the file name. Creating the prefix string is no problem, but I can't figure out how to tack that onto the front of the filename. If I...

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...

How to get the file name from a String containing the path plus the file name?
Hi, I have a String "dirA/dirB/dirC/file.txt". How to use String manipulation technique to get "file.txt"? String fullName = "dirA/dirB/dirC/file.txt"; int index = fullName.lastIndexOf("\\"); //here is a problem, if I try lastIndexOf("\"), there is a compile error String fileName = fullName.subString(index); //but does not work Thank you very much. ps: I am working on linux. www wrote: > Hi, > > I have a String "dirA/dirB/dirC/file.txt". How to use String > manipulation technique to get "...

How to get short file name (8.3) from long file name
Hello Group, Any way in xHarbour to get the short file name, i.e. xxxxxx~1.ext, from a long file name? I want to use an old utility program that accepts only short file names with the RUN command. Klaus has a Clipper function in his LF_ library but since I am working with a large file, I want to see if xHarbour can process it faster. (btw, thanks again Klaus, for the LF_ library). Thanks, Ted On Mar 12, 7:27 am, Ted <ted.kobaya...@gmail.com> wrote: > Hello Group, > > Any way in xHarbour to get the short file name, i.e. xxxxxx~1.ext, > from a long file name? I want to ...

how do I tell a browser the name of a file, for download, if the file has open space in its name?
I've got a music studio for a client. Their whole studio is run with Macintosh computers. Macintosh computers allow file names to have open white spaces, such as "animal hospital.mp3". I have a download script, so customers on the website can download MP3s to their harddrive (rather than merely listen to it in their browsers): $fileToBuy = $_GET["fileToBuy"]; if ($fileToBuy) { $pathToFile = "temporary_files/$fileToBuy"; if (!file_exists($pathToFile)) $pathToFile = "site_specific_files/ $fileToBuy"; if (!file_exists($pathToFile)) $pathToFile =...

[ace-users] Re: Too long file names and duplicate file names.
Hi David, > I attach the .DOC file with the errors. Great, thanks very much! I've put this file at http://www.dre.vanderbilt.edu/~schmidt/Doc_unzip.doc in case people are interested. > The Y/N char in blue next to each of the duplicate indicates what > was my response to the choices. I chose "Y" when the second file > was larger or have a more recent date, which is of course stupid... > because I figured out later that we are talking about different > files by their content. All of these files are documentation files auto-generated by D...

Admin Process: File name: NAMES.NSF; Name:
As Administrator I recently change my name. Now every time the AdminP start I get this. 2005-02-09 04:59:03 Admin Process: File name: NAMES.NSF; Name: << MY OLD NAME>> : User name not found in Name and Address Book What have I missed ? Where to look TIA. "McDuff" <Mc@Duff.is> wrote: >As Administrator I recently change my name. > >Now every time the AdminP start I get this. > >2005-02-09 04:59:03 Admin Process: File name: NAMES.NSF; Name: << MY OLD >NAME>> : User name not found in Name and Address Book > ...

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 extract path/file name upto the mzximum of two levels from the file name?
Dear Group, I have a input file with the following details, $ cat my_input.dat /A1/b1/c1/file1 /A1/b1/file1 /A2/b1/c1/d1/file2 /A2/b1/file1 /A2/b2/file1 /A3/file1 /A3 /A4 I want to get only the first two levels. I will "unique" this ouput and the final reault has to be, /A1/b1 /A2/b1 /A2/b2 /A3/filename /A3 /A4 (ie, the extracted files/path will have a maximum of two "/" s) How would I get this done in ksh? (awk/sed anything is fine) Thanks... On 2005-10-28, da wrote: > Dear Group, > > I have a input file with the following details, > > $ cat my_inp...

rename all the file names in a directory so that the first character of each file name is lower case
How to rename all the file names in a directory so that the first character of each file name is lower case in the bash shell? e.g. old file names are: Certificates General Util.dsp new file names become: certificates general util.dsp On 2008-09-07, TsanChung wrote: > How to rename all the file names in a directory so that the first > character of each file name is lower case in the bash shell? > e.g. > old file names are: > Certificates > General > Util.dsp > > new file names become: > certificates > general > util.dsp _lwr() { _LWR= case $1 in ...

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...

[ace-users] Re: Too long file names and duplicate file names. #2
Hi, > Johnny and Doug > > 1. Doc tools > I am not familiar with using Doxygen but any decent doc generator that > deserve to be called automatic, should be able, upon the change of a > name to also change all the pointers/hyperlinks that point to that name > respectively automatically. The problem is that we do have pages written outselves that refer to the doxygen generated names. Those are then broken. Johnny ...

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...