Tip of the day - Failed IMPORT

Brian K. White brian at aljex.com
Fri Jun 17 19:34:30 PDT 2005


----- Original Message ----- 
From: "Lerebours, Jose" <Jose.Lerebours at EagleGL.com>
To: <filepro-list at seaslug.org>
Sent: Friday, June 17, 2005 2:22 PM
Subject: RE: Tip of the day - Failed IMPORT


> Jerry Rains wrote:
>
> > I learned something today.
> >
> > If you have a one line file that you are trying to IMPORT
> and there is
> > no LineFeed on the end the IMPORT will fail.
> >
> > By the same token.  I assume that if you have a multi-line file and
> > there is no LineFeed on the last line you will prematurely
> finish the
> > IMPORT without importing the last line.
> >
> > Something to watch out for.
> >
> >
> Jerry,
>
> This makes sense if you told it to look for a end-of-record
> marker and
> it was not there.  If you use other techniques to read the file or
> change the options for IMPORT it might not be an issue.
>

While in the subject, I just came across something I had never
experienced.

I need to dynamically assign the field separator.  I have a group
of users that have their excel saving CSV documents using semicolon (;)
in lieu of commas (,).  Since others have it the right way, I need
to have program switch according to user profile.

I have a dummy variable (no edit) holding a comma or a semicolon,
using command   import ascii ref = (za) f=s  r=\n o=" c="
I do not get the desired results.

Unfortunately, I cannot use the condition in the same line as an
import command nor could I have the same import command twice.

What would be the remedy for something like this?

Regards;

---------sorry, mail client doesn't know how to add the >'s to mark quotes 
when the mail came in as html so above is old, below is new----------------

multiple versions of the import command each in their own gosub
conditionally choose which gosub

if: csv   then: gosub csvin
if: ssv   then: gosub ssvin
[...]
csvin: if: then: import ... f=' ...
if: then: return
ssvin: if: then: import ... f=; ...
if: then: return

Excel is no-excuses broken if it allows you to set "csv export" to use 
anything other than a comma as the field seperator and it has nothing to do 
with ivory tower purity of adhering to standards other than the freaking 
english language.
CSV = Comma Seperated Values!  C!  Comma! C!
Semicolon seperated values is by definition not comma seperated values. 
(hence the "ssv" and "ssvin" above)
It should be under a generic text export option along with csv export, but 
not by modifying csv so that csv is not in fact csv.
Just like they have a tab-seperated export as a seperate choice.
If that IS the case, then you should be able to always get csv's by just 
telling people to always use the CSV choice instead if the TXT choice.

Let me put this another way to show just how built-in, indelibly, innately, 
no-excuses, stupid it is...
By offering such a choice as exporting to csv with something else instead of 
commas, but still calling it csv,
it shows that apparently Microsoft would actually fail to get the old "What 
color was George Washingtons white horse?" joke!
I should take away the exclamation. I should not be surprised. :)

Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani



More information about the Filepro-list mailing list