[V4RB] Importing tab-delim.

Pedro fp lists at pedro.Net.au
Sun Apr 6 20:53:21 CDT 2003


On Sunday, April 6, 2003, at 06:20  PM, Ruslan Zasukhin wrote:

>> Am I correct in believing that ImportText requires having an active
>> vCursor and that the vCursor must have the fields represented in the
>> import file in the same order as in the import file?
>
> Yes.

Great :)

>> Can the initial vCursor be one with no records?
>
> In fact this is even better!
>
>         use WHERE RecID = 0

Thanx :)

>> Can the vCursor have fields in addition to those being imported?
>
> Mmm, only if they are AFTER all fields in file.

As I had imagined.

>> In my case I have a bunch of [meta data] fields that are calculated on
>> import. If these can be part of the vCursor on which the ImportText is
>> performed it would mean I do not have to get a new vCursor for
>> calculation of these.
>
> IF this is YOUR calculations in RB code, then Valentina's Import of 
> course
> cannot calulate them. And you can not do this using first cursor, 
> because
> Valentina will not return control to you until it finish Import.
>
> So you must calculate them later after import.

Again as I had imagined.

So which would be faster [if there is any significant difference]? ...
1.	Import the file line by line, doing the calculations & then calling 
AddRecord for each line.
or
2.  Use ImportText & then loop through the cursor to do the 
calculations & call cur.Update() for every new record.
There are 14 calculated fields [plus 3 pointers for self-joins] and 
anything from 1 to 12 imported fields if this information makes any 
difference.

Looking at it written like that it would seem to me that using 
ImportText could only be faster here if Update() is significantly 
faster than AddRecord.

>> Does ImportText treat the first row of the import file as data or
>> headers?
>
> As data

Which reminds me of a suggestion [feature request] I had meant to 
include in my earlier email. Perhaps a future revision of Valentina 
could give ImportText an additional property like ...
	hasHeader As boolean
Making it optional with a default value of false would mean existing 
code would not need changing.

This would make it much simpler for we developers to accommodate import 
files with headers.

I have some further thoughts which I shall send you off list shortly.

>> Concerning the documentation ...
>>
>> I've also found a number of errors that can be quite confusing. Most
>> immediately, the ImportText & ExportText methods both have the
>> description for FieldDelimiter repeated as the description for
>> LineDelimiter.
>
> I will check this.

Would you like me to let you know of others as I find them? Off list I 
think.

>> I appreciate the good work that's already gone into the Valentina
>> documentation. If someone from the documentation team wants to contact
>> me off list <mail at pedro.Net.au> I'd be happy to help as I can on both
>> these fronts.
>
> In fact no doc team yet. I have write it self.

I had thought that all the people named under "Acknowledgments" might 
have been the doc team.

> My dream is to get one or 2 helpers on docs.
> There is chances that I will get them for 2.0 ver.

Please consider me a candidate.

Cheers, Pedro :-)

Web: <http://www.pedro.net.au>                    PGP Key ID: 387CD96F
Instant messaging...  AIM: bandidoOfOz  ICQ: 27671678  Jabber: pedrofp
                       MSN: mail at pedro.net.au           Yahoo: pedro_fp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"What difference does it make to the dead, the orphans, and the
homeless, whether the mad destruction is brought under the name
of totalitarianism or the holy name of liberty and democracy?"
                                            M K (Mahatma) Gandhi




More information about the Valentina mailing list