dbTalk Databases Forums  

Easily Import Pipe Delimited Data Into Filemaker

comp.databases.filemaker comp.databases.filemaker


Discuss Easily Import Pipe Delimited Data Into Filemaker in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
squeed2000@yahoo.com
 
Posts: n/a

Default Easily Import Pipe Delimited Data Into Filemaker - 06-27-2007 , 08:36 PM






Here is a simple way to import pipe "|" delimited data in Filemaker
without the need for a plugin.

I am going to walk you through the basics. You can integrate this
into your solution so that everything is contained within a single
Filemaker file.


Step 1.

Create a Filemaker database with 4 fields. Full Record, Add Quote,
Properly Formatted and Holder

"Full Record" will contain each full record in your database. An
example would be if your first
record is "Joe|Smith|Welder|123 Main Street|Anytown|USA|55555" this
whole record will be held
in the "Full Record" field.

"Add Quote" should be a text field with auto data populate of a quote
(") on import. Ignore the brackets

"Properly Formatted" should be a calculation field with the
calculation of (Add Quote & Full Record & Add Quote)

"Holder" should be a text field with Global Storage and an automatic
data populate of (",") Ignore the brackets



Step 2.

Import your pipe delimited data in to the "Full Record" field.

Step 3.

Create a script called "Format For CSV"

Show All Records
Perform Find/Replace [No Dialog; "|" yourfile.fp7::Holder; Replace
All]
Export Records [No dialog; "Ready_For_CSV_Import.txt"]

Step 4.

Run the script, you will end up with a file called
"Ready_For_CSV_Import.txt" that Filemaker will
import and parse properly.


Reply With Quote
  #2  
Old   
d-42
 
Posts: n/a

Default Re: Easily Import Pipe Delimited Data Into Filemaker - 07-01-2007 , 02:24 PM






On Jun 27, 6:36 pm, squeed2... (AT) yahoo (DOT) com wrote:
Quote:
Here is a simple way to import pipe "|" delimited data in Filemaker
without the need for a plugin.
Nicely done. But it seems like using a screwdriver for a hammers job.
There are some great command line utilities that can simply replace
the pipes with a comma.

sed -i 's/|/,/' filename

ok... that might not work as is... the | and , probably need to be
escaped. I can't recall offhand if they are special control
characters. Plus if commas appear in the actual data, you'd need to
deal with those first, e.g. by adding quotes, or just stripping them
out, or maybe just converting to tab delimited instead of comma-
delimited...

sed is included with OS X, and is a free download for windows.



Reply With Quote
  #3  
Old   
Matt WIlls
 
Posts: n/a

Default Re: Easily Import Pipe Delimited Data Into Filemaker - 07-02-2007 , 08:14 AM



In article <1183317877.478701.219450 (AT) o11g2000prd (DOT) googlegroups.com>
d-42 <db.porsche (AT) gmail (DOT) com> wrote:

Quote:
On Jun 27, 6:36 pm, squeed2... (AT) yahoo (DOT) com wrote:
Here is a simple way to import pipe "|" delimited data in
Filemaker without the need for a plugin.

Nicely done. But it seems like using a screwdriver for a hammers
job. There are some great command line utilities that can simply
replacethe pipes with a comma.

sed -i 's/|/,/' filename

ok... that might not work as is... the | and , probably need to be
escaped. I can't recall offhand if they are special control
characters. Plus if commas appear in the actual data, you'd need to
deal with those first, e.g. by adding quotes, or just stripping
themout, or maybe just converting to tab delimited instead of comma-
delimited...

sed is included with OS X, and is a free download for windows.


I was about to ask what was wrong with using a text editor (lots of
freebies out there) to replace the pipe with a tab before importing.
It then occurred to me that the technique as described can be fully
automatic: import, substitute, export, re-import, all from one script.
No command lines, no text editors, just a FileMaker script, however
you choose to execute it.
OTOH, can sed be executed from AppleScript (as Curl can) or VBScript?
There would be a shorter method in being able to to that.
I have used pipes to delimit multiple script parameters in a Custom
Function, and as placeholders in text I'm cleaning up, but have yet to
see them used elsewhere. Seems to me such a character would actually
be preferable to tabs, commas and quotes, making it possible to have
those three in text without being confused for a delimiter.
Matt





Reply With Quote
  #4  
Old   
d-42
 
Posts: n/a

Default Re: Easily Import Pipe Delimited Data Into Filemaker - 07-02-2007 , 01:27 PM



On Jul 2, 6:14 am, Matt WIlls <I... (AT) Witz (DOT) End> wrote:
Quote:
In article <1183317877.478701.219... (AT) o11g2000prd (DOT) googlegroups.com



d-42 <db.pors... (AT) gmail (DOT) com> wrote:
On Jun 27, 6:36 pm, squeed2... (AT) yahoo (DOT) com wrote:
Here is a simple way to import pipe "|" delimited data in
Filemaker without the need for a plugin.
Nicely done. But it seems like using a screwdriver for a hammers
job. There are some great command line utilities that can simply
replacethe pipes with a comma.

sed -i 's/|/,/' filename

ok... that might not work as is... the | and , probably need to be
escaped. I can't recall offhand if they are special control
characters. Plus if commas appear in the actual data, you'd need to
deal with those first, e.g. by adding quotes, or just stripping
themout, or maybe just converting to tab delimited instead of comma-
delimited...

sed is included with OS X, and is a free download for windows.

I was about to ask what was wrong with using a text editor (lots of
freebies out there) to replace the pipe with a tab before importing.
It then occurred to me that the technique as described can be fully
automatic: import, substitute, export, re-import, all from one script.
No command lines, no text editors, just a FileMaker script, however
you choose to execute it.
OTOH, can sed be executed from AppleScript (as Curl can) or VBScript?
There would be a shorter method in being able to to that.
I have used pipes to delimit multiple script parameters in a Custom
Function, and as placeholders in text I'm cleaning up, but have yet to
see them used elsewhere. Seems to me such a character would actually
be preferable to tabs, commas and quotes, making it possible to have
those three in text without being confused for a delimiter.
Matt
It would be ideal if FM actually let you specify the delimeter for
imports, would save all kinds of aggravation. Then you can handle
colon, semicolon, pipe, comma, period, dollar sign and all the other
oddball stuff. And its a trivial enhancement to make.

As for sed, its a command line utility that requires no interaction
during use, so yeah you can trivially execute it from applescript or
the windows command line (don't even need vbscript).

Doing it all within filemaker has the advantage that that it is all
within filemaker, and that's worth something, its easier to deal with
things like error conditions etc, e.g. if the file is missing, or
locked or something.

-cheers,
dave






Reply With Quote
  #5  
Old   
Bill Marriott
 
Posts: n/a

Default Re: Easily Import Pipe Delimited Data Into Filemaker - 07-10-2007 , 11:24 PM



Quote:
Doing it all within filemaker has the advantage that that it is all
within filemaker, and that's worth something, its easier to deal with
things like error conditions etc, e.g. if the file is missing, or
locked or something.
A really small command-line utility can also be incorporated into FileMaker.
Just include the utility in a container field and have your script write out
both the utility and data file to be processed as part of the script, to a
known write-able folder. This is not strictly "pure" but it doesn't depend
on external files -- which is what most people are wanting when they are
looking for "self-contained" solutions.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.