Import text file into a field

Import text file into a field

am 12.09.2007 01:20:05 von d-42

Hi,

I need to import a text file into a field for further parsing. All to
be done via a script.

I know I can do this with Import Folder, selecting text files, but is
there a way of doing this by just naming the file?

Importing a folder (and arranging things so that there is only one
file in the folder) seems clumsy.

This is for FM8, but if 8.5 / 9.0 can do it better/differently, I am
always looking for more reasons to justify an upgrade.

-regards,
Dave

Re: Import text file into a field

am 12.09.2007 09:27:41 von Helpful Harry

In article <1189552805.367487.78200@t8g2000prg.googlegroups.com>, d-42
wrote:

> Hi,
>
> I need to import a text file into a field for further parsing. All to
> be done via a script.
>
> I know I can do this with Import Folder, selecting text files, but is
> there a way of doing this by just naming the file?
>
> Importing a folder (and arranging things so that there is only one
> file in the folder) seems clumsy.

The Import Records script command allows you to specify a filename ...
but it will have to be the same filename every time the script is run
(or at least in my version the filename is "hard coded" and you can't
use a field to hold filenames).




> This is for FM8, but if 8.5 / 9.0 can do it better/differently, I am
> always looking for more reasons to justify an upgrade.

Personally, the more I hear about the silly non-Committing of records,
the less I want to upgrade from FileMaker 5.5. :o(

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Import text file into a field

am 12.09.2007 10:22:12 von dempson

Helpful Harry wrote:

> In article <1189552805.367487.78200@t8g2000prg.googlegroups.com>, d-42
> wrote:
>
> > I need to import a text file into a field for further parsing. All to
> > be done via a script.
> >
> > I know I can do this with Import Folder, selecting text files, but is
> > there a way of doing this by just naming the file?
> >
> > Importing a folder (and arranging things so that there is only one
> > file in the folder) seems clumsy.
>
> The Import Records script command allows you to specify a filename ...
> but it will have to be the same filename every time the script is run
> (or at least in my version the filename is "hard coded" and you can't
> use a field to hold filenames).

Same in version 9. It lets you specify a list of files, so it will be
able to search for several candidate files, but you can't use a field or
calculation to construct the filename(s).

You can also import all files (either pictures/movies or text) in a
specified folder or from the first folder it can find in a list.

You can also import an XML data source from a specified file, with an
HTTP request, or a calculation which derives a file or HTTP request.

> > This is for FM8, but if 8.5 / 9.0 can do it better/differently, I am
> > always looking for more reasons to justify an upgrade.
>
> Personally, the more I hear about the silly non-Committing of records,
> the less I want to upgrade from FileMaker 5.5. :o(

That appears to have started with version 8, so d-42 won't be worse off
with version 9 (apart from activation).

--
David Empson
dempson@actrix.gen.nz

Re: Import text file into a field

am 12.09.2007 11:21:26 von d-42

On Sep 12, 12:27 am, Helpful Harry
wrote:
> In article <1189552805.367487.78...@t8g2000prg.googlegroups.com>, d-42
>
> wrote:
> > Hi,
>
> > I need to import a text file into a field for further parsing. All to
> > be done via a script.
>
> > I know I can do this with Import Folder, selecting text files, but is
> > there a way of doing this by just naming the file?
>
> > Importing a folder (and arranging things so that there is only one
> > file in the folder) seems clumsy.
>
> The Import Records script command allows you to specify a filename ...
> but it will have to be the same filename every time the script is run
> (or at least in my version the filename is "hard coded" and you can't
> use a field to hold filenames).

Er, import records won't let me import an entire text file into a
single field though, will it?

As for specifying a filename, import records (and any other script
step that supports file references, supports variable names in the the
filename, so you can use fields to hold filenames, provided you set
the variable to the name, before importing the record... but that was
never the issue. The issue is to get an entire file into a field...

e.g. suppose I were to send event : cmd /c ipconfig /all > c:\temp
\ipconfig.txt
that would cause the command shell to write out the tcp/ip
configuration data to a file. And what I'd like to do is then import
that file into a global field to be parsed for dns entries, for
example. (That is not what I'm working on, but it illustrates the idea
well enough.)

> > This is for FM8, but if 8.5 / 9.0 can do it better/differently, I am
> > always looking for more reasons to justify an upgrade.
>
> Personally, the more I hear about the silly non-Committing of records,
> the less I want to upgrade from FileMaker 5.5. :o(

Oh I dunno. The non-committing of records allows for much easier
support for atomic transactions for one thing, which is an absolute
godsend. But yeah, I'm still mired in a 5.5 to 7+ re-architecture job,
and probably will be for a few years to come.

cheers,
Dave

Re: Import text file into a field

am 12.09.2007 11:34:49 von dempson

d-42 wrote:

> On Sep 12, 12:27 am, Helpful Harry
> wrote:
> > In article <1189552805.367487.78...@t8g2000prg.googlegroups.com>, d-42
> >
> > wrote:
> > > Hi,
> >
> > > I need to import a text file into a field for further parsing. All to
> > > be done via a script.
> >
> > > I know I can do this with Import Folder, selecting text files, but is
> > > there a way of doing this by just naming the file?
> >
> > > Importing a folder (and arranging things so that there is only one
> > > file in the folder) seems clumsy.
> >
> > The Import Records script command allows you to specify a filename ...
> > but it will have to be the same filename every time the script is run
> > (or at least in my version the filename is "hard coded" and you can't
> > use a field to hold filenames).
>
> Er, import records won't let me import an entire text file into a
> single field though, will it?

FileMaker 9's Import Records script step will do that, if you specify a
folder. It will import each text file in the specified folder into a new
record, putting the file content in a single field. You can also set
other fields to the name and path of the source file.

This wasn't mentioned as a new feature in version 9, so perhaps you have
it in version 8 as well.

I've leapt from FM7 to 9, but didn't use many new features in 7, so
version 6 is really the last version I was familiar with.

> As for specifying a filename, import records (and any other script
> step that supports file references, supports variable names in the the
> filename, so you can use fields to hold filenames, provided you set
> the variable to the name, before importing the record... but that was
> never the issue. The issue is to get an entire file into a field...

Ah, that's a useful tip. BTW, script variables are a relatively new
feature - added in FM8, as far as I can tell.

> e.g. suppose I were to send event : cmd /c ipconfig /all > c:\temp
> \ipconfig.txt
> that would cause the command shell to write out the tcp/ip
> configuration data to a file. And what I'd like to do is then import
> that file into a global field to be parsed for dns entries, for
> example. (That is not what I'm working on, but it illustrates the idea
> well enough.)

Create a dedicated folder, put the file (or files) in that folder, and
use Import Records (specifying the folder).

Filename must end with .txt. (On the Mac, it can also be any name but
have a filetype of 'TEXT'.)

--
David Empson
dempson@actrix.gen.nz

Re: Import text file into a field

am 12.09.2007 11:40:39 von d-42

On Sep 12, 1:22 am, demp...@actrix.gen.nz (David Empson) wrote:
> Helpful Harry wrote:
> > In article <1189552805.367487.78...@t8g2000prg.googlegroups.com>, d-42
> > wrote:
>
> > > I need to import a text file into a field for further parsing. All to
> > > be done via a script.

> Same in version 9. It lets you specify a list of files, so it will be
> able to search for several candidate files, but you can't use a field or
> calculation to construct the filename(s).

Hmmm... your the 2nd person to say that. I am pretty sure you can use
variable names in file references as of FM8. I've done it on exports
many times. I'm not sure I've tested it on imports, but I'd be
surprised if it only worked on exports.

> You can also import all files (either pictures/movies or text) in a
> specified folder or from the first folder it can find in a list.

Yeah, that's what I've got working now. But I don't want to import
"all files". I just want to import one specific one.

My work around has been to isolate the one specific one into a folder
all by itself, and then import the whole folder. But as I originally
said, that's pretty kludgy; and I thought that if I can import the
text content from each file in a folder full of files that I should be
able to do that for just one particular file.. but it seems not.

> That appears to have started with version 8, so d-42 won't be worse off
> with version 9 (apart from activation).

Luckily I work mostly with VLA's of FM Pro so I'm largely spared that
abuse. However, my FM Advanced licenses are predominantly not VLA,
and I need to be able to run a single instance of advanced on a
terminal server - I had better be able to do that with FM9 like I can
with FM8 or there's going to be a problem. (FM8 correctly refuses to
run a 2nd instance of a single user license on a terminal server, and
that's fine, but I've heard FM9 won't run at all...which is
ridiculous.)


cheers,
Dave

Re: Import text file into a field

am 12.09.2007 12:01:56 von dempson

d-42 wrote:

> On Sep 12, 1:22 am, demp...@actrix.gen.nz (David Empson) wrote:
> > Helpful Harry wrote:
> > > In article <1189552805.367487.78...@t8g2000prg.googlegroups.com>, d-42
> > > wrote:
> >
> > > > I need to import a text file into a field for further parsing. All to
> > > > be done via a script.
>
> > Same in version 9. It lets you specify a list of files, so it will be
> > able to search for several candidate files, but you can't use a field or
> > calculation to construct the filename(s).
>
> Hmmm... your the 2nd person to say that. I am pretty sure you can use
> variable names in file references as of FM8. I've done it on exports
> many times. I'm not sure I've tested it on imports, but I'd be
> surprised if it only worked on exports.

That was just a lack of knowledge on my part, now corrected by reading
the help. You can use variables to specify a file to import, but can't
directly use fields or calculations in the Import Records script step.

> > You can also import all files (either pictures/movies or text) in a
> > specified folder or from the first folder it can find in a list.
>
> Yeah, that's what I've got working now. But I don't want to import
> "all files". I just want to import one specific one.
>
> My work around has been to isolate the one specific one into a folder
> all by itself, and then import the whole folder. But as I originally
> said, that's pretty kludgy; and I thought that if I can import the
> text content from each file in a folder full of files that I should be
> able to do that for just one particular file.. but it seems not.

No, it looks like importing a single file is limited to parsing a text
file to extract columns and rows (or similar).

Seems like a rather annoying oversight.

--
David Empson
dempson@actrix.gen.nz

Re: Import text file into a field

am 12.09.2007 22:43:24 von Helpful Harry

In article <1i4cjdr.xmbmk47crcilN%dempson@actrix.gen.nz>,
dempson@actrix.gen.nz (David Empson) wrote:

> d-42 wrote:
>
> > On Sep 12, 12:27 am, Helpful Harry
> > wrote:
> > > In article <1189552805.367487.78...@t8g2000prg.googlegroups.com>, d-42
> > >
> > > wrote:
> > > > Hi,
> > >
> > > > I need to import a text file into a field for further parsing. All to
> > > > be done via a script.
> > >
> > > > I know I can do this with Import Folder, selecting text files, but is
> > > > there a way of doing this by just naming the file?
> > >
> > > > Importing a folder (and arranging things so that there is only one
> > > > file in the folder) seems clumsy.
> > >
> > > The Import Records script command allows you to specify a filename ...
> > > but it will have to be the same filename every time the script is run
> > > (or at least in my version the filename is "hard coded" and you can't
> > > use a field to hold filenames).
> >
> > Er, import records won't let me import an entire text file into a
> > single field though, will it?
>
> FileMaker 9's Import Records script step will do that, if you specify a
> folder. It will import each text file in the specified folder into a new
> record, putting the file content in a single field. You can also set
> other fields to the name and path of the source file.
>
> This wasn't mentioned as a new feature in version 9, so perhaps you have
> it in version 8 as well.
>
> I've leapt from FM7 to 9, but didn't use many new features in 7, so
> version 6 is really the last version I was familiar with.

You could import the file into a separate table and use a script to
concatenate all the new records back into one field.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Import text file into a field

am 12.09.2007 23:16:48 von d-42

On Sep 12, 1:43 pm, Helpful Harry
wrote:
> In article <1i4cjdr.xmbmk47crcilN%demp...@actrix.gen.nz>,

> You could import the file into a separate table and use a script to
> concatenate all the new records back into one field.

Problematic because I have no way of knowing how many fields I would
need in advance. At any rate, its is even more of a clumsy workaround
than the one I have now. :)

Thanks for the replies though. In this case at least it's confirmed
that the work around I'm using is the best available; and that I
hadn't missed a feature or option.

cheers,
Dave

Re: Import text file into a field

am 12.09.2007 23:31:14 von ursus.kirk

>> > > > I need to import a text file into a field for further parsing. All
>> > > > to
>> > > > be done via a script.
>> > >
>> > > > I know I can do this with Import Folder, selecting text files, but
>> > > > is
>> > > > there a way of doing this by just naming the file?
>> > >
>> > > > Importing a folder (and arranging things so that there is only one
>> > > > file in the folder) seems clumsy.
>> > >
>> > > The Import Records script command allows you to specify a filename
>> > > ...
>> > > but it will have to be the same filename every time the script is run
>> > > (or at least in my version the filename is "hard coded" and you can't
>> > > use a field to hold filenames).
>> > ;o)

Actualy you CAN use hardcoded filenames that are in a field by putting the
value into a temporary variable ($Temp)
Set Variable [$Temp; value:MyTable::MyField]
and then putt that $Temp in the Script step:
Import Records [No Dialog]; "$Temp"]

That should work.

Keep well, Ursus

Re: Import text file into a field

am 12.09.2007 23:56:58 von d-42

> Actualy you CAN use hardcoded filenames that are in a field by putting the
> value into a temporary variable ($Temp)
> Set Variable [$Temp; value:MyTable::MyField]
> and then putt that $Temp in the Script step:
> Import Records [No Dialog]; "$Temp"]
>
> That should work.

Yes, but the real issue is that the "import records" script step won't
import a single specified file into a single specified field.

It either imports a folder of files, one file into one field of one
record for each file, which is total overkill - I only want one
specific file in one specific record.

Or it imports one specific file, but in that case forces me to import
it into multiple fields (depending on whether there are comma/tabs)
and each line becomes its own record even if I want to put the whole
thing in one field in one record - like I can when I import a folder.

-cheers,
dave

Re: Import text file into a field

am 13.09.2007 10:41:36 von Sargasso

d-42 wrote:
>Hi,
>
>I need to import a text file into a field for further parsing. All to
>be done via a script.
>
>I know I can do this with Import Folder, selecting text files, but is
>there a way of doing this by just naming the file?
>
>Importing a folder (and arranging things so that there is only one
>file in the folder) seems clumsy.
>
>This is for FM8, but if 8.5 / 9.0 can do it better/differently, I am
>always looking for more reasons to justify an upgrade.
>
>-regards,
>Dave
>

Soon I will have to tackle the same problem and although I haven't tried or
tested this but I thought I could get the content of a file through the
webviewer. Anybody?

Re: Import text file into a field

am 13.09.2007 10:58:21 von Sargasso

d-42 wrote:
>Hi,
>
>I need to import a text file into a field for further parsing. All to
>be done via a script.
>
>I know I can do this with Import Folder, selecting text files, but is
>there a way of doing this by just naming the file?
>
>Importing a folder (and arranging things so that there is only one
>file in the folder) seems clumsy.
>
>This is for FM8, but if 8.5 / 9.0 can do it better/differently, I am
>always looking for more reasons to justify an upgrade.
>
>-regards,
>Dave
>

As I wrote before I will face the same challenge, i just did a quick test setup
....

I created a table with a container field called "FileReference" and put a file
(by reference) into the container. Then I created a field called "FileName"
which takes the content of FileReference as text and cleaned it up to show just
the full path to the filename.

On a layout I placed a webviewer and assembled the correct url ( "File://" &
FileName ) named de object "objWebviewer" and used the function
GetLayoutObjectAttribute ( "objWebviewer" ; "content" ) to extract the content
of the text file.

It works!

Re: Import text file into a field

am 13.09.2007 13:16:49 von ursus.kirk

"d-42" schreef in bericht
news:1189634218.597501.49590@r29g2000hsg.googlegroups.com...
>
>> Actualy you CAN use hardcoded filenames that are in a field by putting
>> the
>> value into a temporary variable ($Temp)
>> Set Variable [$Temp; value:MyTable::MyField]
>> and then putt that $Temp in the Script step:
>> Import Records [No Dialog]; "$Temp"]
>>
>> That should work.
>
> Yes, but the real issue is that the "import records" script step won't
> import a single specified file into a single specified field.
>
> It either imports a folder of files, one file into one field of one
> record for each file, which is total overkill - I only want one
> specific file in one specific record.
>
> Or it imports one specific file, but in that case forces me to import
> it into multiple fields (depending on whether there are comma/tabs)
> and each line becomes its own record even if I want to put the whole
> thing in one field in one record - like I can when I import a folder.
>
> -cheers,
> dave

Could you rigg a dummy table that would hold (import) the required data in
just one record and then transfer the data you need?

Ursus

Re: Import text file into a field

am 13.09.2007 20:53:28 von d-42

> Could you rigg a dummy table that would hold (import) the required data in
> just one record and then transfer the data you need?
>

No, the text file to be imported is unformatted text, that is multiple
lines. That means that it will import into multiple records, and
worse, filemaker will 'parse' it into multiple fields per record if
there are any commas / tabs in the file.

It could be done, I *could* create a dummy table with 20 fields, (and
hope I never worked on a file with more than 20 commas before a line
break). And then via script conjoin it all back together. But the
other workaround, of isolating the file in its own folder, and then
importing the folder is far better.

-cheers,
Dave

Re: Import text file into a field

am 13.09.2007 20:57:46 von d-42

On Sep 13, 1:58 am, Sargasso wrote:
> d-42 wrote:
> >Hi,
>
> >I need to import a text file into a field for further parsing. All to
> >be done via a script.
>
> >I know I can do this with Import Folder, selecting text files, but is
> >there a way of doing this by just naming the file?
>
> >Importing a folder (and arranging things so that there is only one
> >file in the folder) seems clumsy.
>
> >This is for FM8, but if 8.5 / 9.0 can do it better/differently, I am
> >always looking for more reasons to justify an upgrade.
>
> >-regards,
> >Dave
>
> As I wrote before I will face the same challenge, i just did a quick test setup
> ...
>
> I created a table with a container field called "FileReference" and put a file
> (by reference) into the container. Then I created a field called "FileName"
> which takes the content of FileReference as text and cleaned it up to show just
> the full path to the filename.
>
> On a layout I placed a webviewer and assembled the correct url ( "File://" &
> FileName ) named de object "objWebviewer" and used the function
> GetLayoutObjectAttribute ( "objWebviewer" ; "content" ) to extract the content
> of the text file.
>
> It works!

Very cool. Unfortunately, the Web Viewer was added in 8.5 and I am
using 8.0 on this project. But its a good work around for 8.5 / 9.0.

-regards,
Dave

Re: Import text file into a field

am 13.09.2007 21:34:28 von Christoph Bouthillier

"d-42" schrieb im Newsbeitrag
news:1189552805.367487.78200@t8g2000prg.googlegroups.com...
> Hi,
>
> I need to import a text file into a field for further parsing. All to
> be done via a script.
>
> I know I can do this with Import Folder, selecting text files, but is
> there a way of doing this by just naming the file?
>
> Importing a folder (and arranging things so that there is only one
> file in the folder) seems clumsy.
>
> This is for FM8, but if 8.5 / 9.0 can do it better/differently, I am
> always looking for more reasons to justify an upgrade.
>
> -regards,
> Dave
>

Hello Dave:

Maybe this totally different approach is what you need:

Get the free AutoIt http://www.autoitscript.com/AutoIt/index.php
and write a simple script in any text editor and compile it.

Let FMP open any text editor with the wanted file as the argument; you can
do that dynamically from FMP by passing along the filename from a field.

Now run that compiled AutoIt script from FMP:

Tell AutoIt to wait until that window has opened.
Let AutoIt copy the contents of the window to the clipboard.
Let Autoit switch back to FMP and paste that one special file's content into
that one special field of yours.

That should work.



---
Met vriendelijke groet / Mit freundlichen Gruessen / With kind regards
Christoph Bouthillier
p/o\s/t atsign ohnotekstotaaloh nocom
Leave out: \ / oh no
---

Re: Import text file into a field

am 13.09.2007 21:47:45 von d-42

> That should work.

Interesting idea.

I don't like solutions that alter the clipboard. Well behaved apps
really shouldn't do that.

I don't like windows/keystroke/mouse click script solutions. They're
inherently flaky. (Things move around. Windows has a tendancy to popup
messages from unrelated processes that will interrupt/interfere/ etc.
I'll use them in a pinch... but never my first choice.

I used to use Quickeys for this sort of stuff by the way. Although I
haven't needed this sort of script/macroing for years now.

It also doesn't support OS X, which I need.

thanks,
Dave

Re: Import text file into a field

am 13.09.2007 22:51:57 von Helpful Harry

In article <1189712865.653560.103800@57g2000hsv.googlegroups.com>, d-42
wrote:

> > That should work.
>
> Interesting idea.
>
> I don't like solutions that alter the clipboard. Well behaved apps
> really shouldn't do that.
>
> I don't like windows/keystroke/mouse click script solutions. They're
> inherently flaky. (Things move around. Windows has a tendancy to popup
> messages from unrelated processes that will interrupt/interfere/ etc.
> I'll use them in a pinch... but never my first choice.
>
> I used to use Quickeys for this sort of stuff by the way. Although I
> haven't needed this sort of script/macroing for years now.
>
> It also doesn't support OS X, which I need.

Use Applescript / Automator to open the file in a text editor, then you
can either:

- replace characters returns with something unique, eg. "*P*",
import into a separate FileMaker record / table, and then
re-replace the carriage returns

or

- copy the content and paste into a FileMaker field.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Import text file into a field

am 14.09.2007 01:00:42 von d-42

> > It also doesn't support OS X, which I need.
>
> Use Applescript / Automator to open the file in a text editor, then you
> can either:
>
> - replace characters returns with something unique, eg. "*P*",
> import into a separate FileMaker record / table, and then
> re-replace the carriage returns
>
> or
>
> - copy the content and paste into a FileMaker field.

No disrespect intended, but I'm not sure why we're spending effort on
making increasingly ugly solutions. :)

I can use the already provided workaround of putting the file in its
own folder and using the import folder script step. Its clumsy becasue
there is no good reason that filemaker would support importing an
entire folder of files the way I need to, but not support importing
just one. But at least its simple, and it works without side effects
(like relying on the clipboard, or hoping we pick unique enough
substitutions that won't ever bite us in the ass, or use additional
3rd party software.)

The only solution I've seen which beats the import folder work around
is the webviewer one, but that requires FM8.5 or later, and ideally
we're shooting for 8.0.

-cheers,
Dave

Re: Import text file into a field

am 14.09.2007 09:23:00 von ursus.kirk

"d-42" schreef in bericht
news:1189709608.787093.61820@g4g2000hsf.googlegroups.com...
>
>> Could you rigg a dummy table that would hold (import) the required data
>> in
>> just one record and then transfer the data you need?
>>
>
> No, the text file to be imported is unformatted text, that is multiple
> lines. That means that it will import into multiple records, and
> worse, filemaker will 'parse' it into multiple fields per record if
> there are any commas / tabs in the file.
>
> It could be done, I *could* create a dummy table with 20 fields, (and
> hope I never worked on a file with more than 20 commas before a line
> break). And then via script conjoin it all back together. But the
> other workaround, of isolating the file in its own folder, and then
> importing the folder is far better.
>
> -cheers,
> Dave
>

If there are no TABs in your text file, you could import the file as TAb
delimited, thus ignoring the comma's

One other way would be to use a plug-in like Troi-file plug-in, or the
FileToolbox. And this would be my best bet.
Troi is payware, but will do very well if only needed for a maximum of 40
minutes in one go. After 40 minutes the whole of file maker has to be
restarted to make the plug-in function again. I don't know if they still
support V5.
the FileToolbox is freeware and does support V5. You can download it from:
http://www.geocities.com/SiliconValley/Network/9327/winfiles /release.zip
it comes with full documentation. And allows you read the contents of any
text file in one go.

Keep Well, Ursus

Re: Import text file into a field

am 14.09.2007 09:26:37 von ursus.kirk

"Ursus" schreef in bericht
news:46ea36bd$0$79000$dbd4b001@news.wanadoo.nl...
>
> "d-42" schreef in bericht
> news:1189709608.787093.61820@g4g2000hsf.googlegroups.com...
>>
>>> Could you rigg a dummy table that would hold (import) the required data
>>> in
>>> just one record and then transfer the data you need?
>>>
>>
>> No, the text file to be imported is unformatted text, that is multiple
>> lines. That means that it will import into multiple records, and
>> worse, filemaker will 'parse' it into multiple fields per record if
>> there are any commas / tabs in the file.
>>
>> It could be done, I *could* create a dummy table with 20 fields, (and
>> hope I never worked on a file with more than 20 commas before a line
>> break). And then via script conjoin it all back together. But the
>> other workaround, of isolating the file in its own folder, and then
>> importing the folder is far better.
>>
>> -cheers,
>> Dave
>>
>
> If there are no TABs in your text file, you could import the file as TAb
> delimited, thus ignoring the comma's
>
> One other way would be to use a plug-in like Troi-file plug-in, or the
> FileToolbox. And this would be my best bet.
> Troi is payware, but will do very well if only needed for a maximum of 40
> minutes in one go. After 40 minutes the whole of file maker has to be
> restarted to make the plug-in function again. I don't know if they still
> support V5.
> the FileToolbox is freeware and does support V5. You can download it from:
> http://www.geocities.com/SiliconValley/Network/9327/winfiles /release.zip
> it comes with full documentation. And allows you read the contents of any
> text file in one go.
>
> Keep Well, Ursus

Sorry, but File Toolbox doesn't support OSX. Leaves only tr

ursusoi.

Re: Import text file into a field

am 15.09.2007 00:26:47 von Helpful Harry

In article <46ea36bd$0$79000$dbd4b001@news.wanadoo.nl>, "Ursus"
wrote:

> "d-42" schreef in bericht
> news:1189709608.787093.61820@g4g2000hsf.googlegroups.com...
> >
> >> Could you rigg a dummy table that would hold (import) the required data
> >> in just one record and then transfer the data you need?
> >
> > No, the text file to be imported is unformatted text, that is multiple
> > lines. That means that it will import into multiple records, and
> > worse, filemaker will 'parse' it into multiple fields per record if
> > there are any commas / tabs in the file.
> >
> > It could be done, I *could* create a dummy table with 20 fields, (and
> > hope I never worked on a file with more than 20 commas before a line
> > break). And then via script conjoin it all back together. But the
> > other workaround, of isolating the file in its own folder, and then
> > importing the folder is far better.
> >
> > -cheers,
> > Dave
> >
>
> If there are no TABs in your text file, you could import the file as TAb
> delimited, thus ignoring the comma's


Unfortunately that's no good for him either since there are carriage
returns in the file which causes FileMaker to import separate records,
rather than the entire text file into one field.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Import text file into a field

am 15.09.2007 01:13:52 von Chris Brown

d-42 wrote:
>>> It also doesn't support OS X, which I need.
>> Use Applescript / Automator to open the file in a text editor, then you
>> can either:
>>
>> - replace characters returns with something unique, eg. "*P*",
>> import into a separate FileMaker record / table, and then
>> re-replace the carriage returns
>>
>> or
>>
>> - copy the content and paste into a FileMaker field.
>
> No disrespect intended, but I'm not sure why we're spending effort on
> making increasingly ugly solutions. :)
>
> I can use the already provided workaround of putting the file in its
> own folder and using the import folder script step. Its clumsy becasue
> there is no good reason that filemaker would support importing an
> entire folder of files the way I need to, but not support importing
> just one. But at least its simple, and it works without side effects
> (like relying on the clipboard, or hoping we pick unique enough
> substitutions that won't ever bite us in the ass, or use additional
> 3rd party software.)
>
> The only solution I've seen which beats the import folder work around
> is the webviewer one, but that requires FM8.5 or later, and ideally
> we're shooting for 8.0.
>
> -cheers,
> Dave
>
>


I just tried a few tests. OSX.4.10, FM 8.5Adv

a simple text file (.txt) containing 3 lines of text, line one with a
tab, line 2 with a comma:

aa aaaa
bbb, bbb
ccccc

import folder containing the file produces a single record, with one
line of text, tab and comma preserved, that looks like this:

aa aaaa bbb, bbb ccccc

When this single line of text in the text field is copied, then pasted
into Pages (Apple word processor), or Thunderbird, the result is the
same as the original file; there are 3 lines of text (with tabs and comma)


MS Word of course gets it wrong (as usual) and inserts an indent at the
start of line 3 for some reason

This suggests that the pilcrows/line breaks are preserved in the FM
import, just that they are recoded? so it may be an encoding issue.


regards

Chris