imported file name

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
Bob
11/15/2004 12:56:53 AM
comp.databases.filemaker 11090 articles. 0 followers. amosw01 (46) is leader. Post Follow

14 Replies
504 Views

Similar Articles

[PageSpeed] 30
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Bob
11/18/2004 10:10:13 PM
Reply:
Similar Artilces:

Import into Address Book?
Apple's Address Book only imports vCards or LDIF files...can anyone tell me how to import my contacts from either Entourage, Palm Desktop, or Now Contact? I want to bring my contacts into my new Sony Ericsson t68i phone and use iSync to back up everything, but I can't seem to get the Address Book "import" function to work. Any help appreciated! Well there is an excellent Applescript that comes with 10.2 that will bring the address book information from Entourage, and a couple of other programs as well and inputs them into the address book. /Applications/AppleScript/Example...

ms2036a loading a calibration file
Hi, &nbsp; Could I have some assistance as to&nbsp;if there is a way to&nbsp;upload just a calibration file&nbsp;instead of invoking or&nbsp;calling the whole equipment set up (stp file extension), as it is done on&nbsp;Anritsu model 37369A. &nbsp; Loading a calibration file on the Anritsu model 37369 is very quickly but on the ms2026a it takes over 20 seconds to upload a calibration file, because the whole equipment set-up needs to be called ("xxxx.stp").&nbsp; Is this assumption correct?&nbsp; Thanks, &nbsp; Frank &nbsp; Hi Frank, I coul...

Patchmaster .dat files
Hello, I am having difficulties loading .dat files that I got from Patchmaster. I tried the ImportHEKALegacy function and all I get is an empty set. Could someone please help me with this? ...

MSs fully imported asset Julian Odell, oops!
sounds a pommy ba.... Yeaph, appointed as an Architect, a jerk! > > sounds a pommy ba.... > "@ ac.com" wrote: > Yeaph, appointed as an Architect, a jerk! > >> >> sounds a pommy ba.... >> ...

Exporting csv file
I'm having issues getting all the information from 3-4 databases into one csv file.. What easy thing am I missing this time? Like always your help is appreciated.. Mike header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=export.csv"); header("Pragma: no-cache"); header("Expires: 0"); $select = "SELECT * FROM ordersCopy O, orders_products P, orders_total Q WHERE O.orders_id=P.orders_id OR O.orders_id=Q.orders_id AND orders_status='3'"; $export = mysql_query($select); $count = mysql...

get name of a dir
Hi. When I dir('*.fig'), I get a list of 100x1 struct. I would like to extract out all the 'name' of the struct. Meaning get the 100 names from this dir into an array of names. How do I do it? Do I have to write a for loop to get this names? Or is there a single function I'm missing? Thank you. Marc Marc Sean wrote: > Hi. > > When I dir('*.fig'), I get a list of 100x1 struct. I would like to > extract out all the 'name' of the struct. Meaning get the 100 names from > this dir into an array of names. How do I do it? Do I have t...

Music files
i need opinions what is your fave music file type? tell me now! i will make u famous if u do u will be in my first prize sciene fair project in L.A.!! Yipes! Think you maybe need to redo your project, since file type best depends on what is the situation. ...

How to use a .desktop file.
I just downloaded an app which has a .desktop file. The protocol seems to be to put it in /usr/share/applnk/ (in my case) but what is its function there? I put it in my ~/Desktop directory and it gave me a launcher there, of course. Doug. -- You cannot shake hands with a clenched fist. - Indira Gandhi. ...

Re: invalid variable name #3
Mohit It contains 33 characters and the limit is 32. I had to count it a couple times to realize this. Nat Wooding Mohit Bhatia <mohit.b.bhatia@A EXP.COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject invalid variable name 11/27...

Name of control domain from local domain?
How can I find out the name of the control domain from a shell on the local domain? If this isn't possible, what's the best possible low-maintenance fudge to make it so? ...

why import, reload, import again?
Near the beginning of file test_matrix.py from scipy are the lines import scipy.base reload(scipy.base) from scipy.base import * del sys.path[0] Could someone please explain why the first two lines were included? A similar script I wrote works fine without them. Also, what is the purpose of the "del" line? (I understand the mechanics of what "del" does.) The scipy developers are skilled Python programmers, so I am trying to understand the idioms used in their codes. beliavsky@aol.com wrote: > Near the beginning of file test_matrix.py from scipy are the lines > &g...

iTunes import skipping problem
Well, I think I tried almost everything and can't figure out what's going wrong: I'm using iTunes to import tracks to my HD in mp3/m4a format. The problem is, the tracks skip- sorta like a scratched up record. They always skip in the same spot and I have tried using using different media players and got the same result. I have plenty of RAM (1Gig), and it's definitely not a playback problem. I ripped the same tracks using other software, and they work just fine. BUT- I'd really like to figure out what's going wrong with iTunes because it is (well, should be) more ...

Panther & FireWire 800 Update--Important News
10-31-2003 From Apple Computer, Inc. Important news--If you use a FireWire 800 disk drive with Mac OS X, (10.3 Panther) please read this special message: http://www.apple.com/macosx/firewire800specialmessage.html > Apple has identified an issue with external FireWire hard drives using > the Oxford 922 bridge chip-set with firmware version 1.02 that can > result in the loss of data stored on the disk drive. Apple is working > with Oxford Semiconductor and affected drive manufacturers to resolve > this issue which resides in the Oxford 922 chip-set. > In the interim, Apple r...

Can I import a folder of images into a document as separate layers?
Hi, I have a collection of cloud pictures I want to put into a single PS file. Is there a way to do this?? Thanks for any help, Dale Dale Glaser wrote: > Hi, > > I have a collection of cloud pictures I want to put into a single PS > file. Is there a way to do this?? > > Thanks for any help, > > Dale' It can be done rather easily with an action. Make a "Master Document" of the right size (bigger that the largest image)outside of the folder. Now make an action that consists of Duplicate Layer choosing the Master as the destination. Then run the a...

Re: Proc Import
On Wed, 8 Oct 2003 12:17:07 -0300, Silvano Cesar da Costa <silvano@UEL.BR> wrote: >Hi folks, > >I have a txt file, something like this: > >032324742478324854237234728743204302482........ > >the two first columns are ID variable, the next three are LOC variable...... > >I have about 250 columns that define 120 variables and 96000 lines >(observations). > >I tried use Proc Import: > >PROC IMPORT OUT= WORK.qualquer > DATAFILE= "C:\Assessoria\Adrian\PR4X.TXT" > DBMS=TAB REPLACE; > GETNAMES=NO; > DA...

Chinese locale file setting
Hi, I noticed that there is no Chinese locale selection my user can choose from the default locale list during installation process. I would like to use HK Traditional Chinese locale. Does anyone know how to setup a HK version of Traditional Chinese locale for FreeBSD? Thanks Sam sam wrote: > Does anyone know how to setup a HK version of Traditional Chinese locale > for FreeBSD? http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/l10n.html Maybe that help. Pertti Kosunen wrote: > sam wrote: > >> Does anyone know how to setup a HK version ...

Announcing HMONSTER - A Monster of an Hi-Res Graphics Converter for Windows BMP files - Now Available for Free Download
Especially for serious Apple II Hi-Res Graphics fans, AppleWin power users, and Apple II Graphics Programmers especially Aztec C65 programmers... but if not, no experience necessary... HMONSTER - A Monster of an Hi-Res Graphics Converter - Now Available for Free Download HMONSTER is a command line Round-Trip Conversion Utility for HGR bitmapped graphics and Windows BMP Files. It also supports several options for tweaking Apple II output. Summary: 1. Converts Monochrome, 16 Color, 256 Color, and 24-Bit Windows BMP files to Apple II Hi-Res Graphics Files in BSaved and Ras...

Important Update #2
Hello, We have an important update at Todayshotnews ! ( www.TodaysHotNews.com/featured.html ) It is the PC controling video, and there have been a few reported ones with many compatibility issues, but this one is the most up-to-date , fully working according to our tests. Check it out, and problems, Contact Our Administrator at TodaysHotNews.com ...

split large xml files
Hi all, I've an XML file that takes more than the hosting time limit to be readed by a PHP script. What I'd like to do is split the large XML file (can be more than 30MB) in little parts and keep the header for every file. Here is the idea: <total> <head> </head> <info> </info> <info> </info> <info> </info> .... </total> The only change is the amount of "info" available. What I'd like is to split the file to create littles ones whit the same <head></head> datas ...

import pysqlite2 or import sqlite3?
Hello, I'm using Python 2.5.1, Pysqlite 2.3.5 and SQLite 3.4.1 on Gentoo Linux. I've always imported pysqlite using from pysqlite2 import dbapi2 and that works. If I try import sqlite3 I get Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/sqlite3/__init__.py", line 24, in <module> from dbapi2 import * File "/usr/lib/python2.5/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ImportError: No module named _sqlite3 And I thought that's normal, there ...

Bind does not resolve host names an returns error.
Hello We use a Debian Box with BIND 9.2.4 Bind is hosting nearly 800 Domain. But sometimes, our Dialup User cant resolv Hostnames. Bind responses with and Servfail. When i restart the Server the problem is solved, but why does it stop resolving some domain? Has anyone had this problem before? What can be the problem? Options are options { directory "/var/named"; listen-on port 53 { xxxxxxxxxxxxxx }; check-names master warn; pid-file "/var/run/bind/run/named.pid"; datasize default; stacksize default; ...

FAQ 6.10 How do I use a regular expression to strip C style comments from a file? #2
This message is one of several periodic postings to comp.lang.perl.misc intended to make it easier for perl programmers to find answers to common questions. The core of this message represents an excerpt from the documentation provided with Perl. -------------------------------------------------------------------- 6.10: How do I use a regular expression to strip C style comments from a file? While this actually can be done, it's much harder than you'd think. For example, this one-liner perl -0777 -pe 's{/\*.*?\*/}{}gs' foo.c will work in many but not al...

Write formatted XML to a file
Hi,I create the XML with DOM and save it to a file. But when I open suchfile with Notepad, for instance, I see the XML file in one line - itis not formatted/aligned. If I open it with IExplorer it looks fine.I am looking for the way to save XML to a file so that XML would beformatted.The save code:-------------------doc.getDocumentElement().normalize();DOMSource ds = new DOMSource(doc);StreamResult sr = new StreamResult(out);TransformerFactory tf = TransformerFactory.newInstance();Transformer trans = tf.newTransformer();trans.transform(ds, sr);Thanks,Pavel On Jul 17, 9:52 am, "pavel.ore.....

Problem with downloading elf file to ML403 using XMD
Hi, I am currently working on a new board based on a Xilinx Virtex-4 FPGA.We are using a ML403 board as SW a development platform. The plan is to run VxWorks (Tornado 2.2.1/Vxworks 5.5.1) so now I am trying to get the VxWorks bootrom to run on the ML403. I have used the XPS - Base System Builder Wizard to build a base system that seems to work (I can run the memory test application Ok). Using the VxWorks BSP from XPS I have build a VxWorks bootrom (bootrom_uncmp) without any errors. I have used a Xilinx app. note as a reference for building the bootrom. I connect to the ML403 using JTAG cab...

important
www.zinatqoi.blogspot.com ALLAH Peanut Butter Sandwiches, Ah, Ah, Ah! Bill Garber from GS-Electronics http://www.garberstreet.com "If you wish to forget anything on the spot, make a note that this thing is to be remembered." (Edgar Allen Poe) "zinatqoi" <zinatqoi@yahoo.com> wrote in message news:2851037f-5a13-4f10-8432-7f8a7ba4c06c@s1g2000prg.googlegroups.com... > www.zinatqoi.blogspot.com ...