APPEND FROM DELIMITED WITH other char not comma ARE NOT IMPL

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
arturo_lopesoria
Posts: 31
Joined: Tue Sep 09, 2008 3:05 am
Location: Mexico

APPEND FROM DELIMITED WITH other char not comma ARE NOT IMPL

Post by arturo_lopesoria »

Hello all

I'm Using hmg v3.0.25. I'm trying to append to a dbf from a delimited data txt file using:
APPEND FROM xcFile DELIMITED WITH optional clause

I can actually import data this way if the fields from file txt came delimited with commas.

But if data are separated with other different character as Pipe '|' APPEND FROM xcFile DELIMITED WITH '|' do not function as clipper/dbase original design was made

It seems like if nothing else was need this option with harbour actually..
or maybe I am doing something bad?

Thanks in advance
Arturo

Im Using hmg v3.0.25
C:\hmg.3.0.25\HARBOUR\bin>harbour
Harbour 2.0.0 (Rev. 13372)
Copyright (c) 1999-2010, http://www.harbour-project.org/

Saludos
Arturo
User avatar
arturo_lopesoria
Posts: 31
Joined: Tue Sep 09, 2008 3:05 am
Location: Mexico

Re: APPEND FROM DELIMITED WITH other char not comma ARE NOT

Post by arturo_lopesoria »

I found the way this command is implemented in harbour:

APPEND FROM DELIMITED WITH PIPE

Is very usefull if comma may to be used inside a field, as part of data, like in a addres, etc..

I hope this will hope to somebody

Saludos desde Mexico
Arturo.
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: APPEND FROM DELIMITED WITH other char not comma ARE NOT

Post by Rathinagiri »

Thanks a lot for the info.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: APPEND FROM DELIMITED WITH other char not comma ARE NOT

Post by esgici »

Hola Arturo, saludos desde Turkiye :)
arturo_lopesoria wrote: APPEND FROM xcFile DELIMITED WITH '|' do not function.
...
I found the way this command is implemented in harbour:
APPEND FROM DELIMITED WITH PIPE
Is very usefull if comma may to be used inside a field, as part of data, like in a addres, etc..
Does "PIPE" is a built-in (by Harbour) constant or we have declare and initialize it ?

such as

Code: Select all

#define PIPE "|"  // .or. CHR( 124 )

.or. 

PUBLIC PIPE "|"  // .or. CHR( 124 )
Anyway it isn't logical

Code: Select all

APPEND FROM xcFile DELIMITED WITH PIPE
will work, though

Code: Select all

APPEND FROM xcFile DELIMITED WITH '|' 
doesn't work. :?

If so, IMHO this will be considered a bug in Harbour :?

Any opinion :?:
Last edited by esgici on Sat Sep 08, 2012 9:34 pm, edited 1 time in total.
Viva INTERNATIONAL HMG :D
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: APPEND FROM DELIMITED WITH other char not comma ARE NOT

Post by Rathinagiri »

This is from Harbour changelog:

APPEND FROM ... DELIMITED WITH TAB
APPEND FROM ... DELIMITED WITH PIPE
APPEND FROM ... DELIMITED WITH ( { cStrDelim, cFldSeparator } )

It seems that, 'PIPE' is hard coded in src/rdd/dbcmd.c
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: APPEND FROM DELIMITED WITH other char not comma ARE NOT

Post by esgici »

Thanks Rathi :)

Best regards
Viva INTERNATIONAL HMG :D
User avatar
arturo_lopesoria
Posts: 31
Joined: Tue Sep 09, 2008 3:05 am
Location: Mexico

Re: APPEND FROM DELIMITED WITH other char not comma ARE NOT

Post by arturo_lopesoria »

Esgici, Rathi.
Thanks to both as allways
Arturo
User avatar
Czarny_Pijar
Posts: 172
Joined: Thu Mar 18, 2010 11:31 pm
Location: 19.2341 E 50.2267 N

Re: APPEND FROM DELIMITED WITH other char not comma ARE NOT

Post by Czarny_Pijar »

The command

COPY FIELDS ID,NAME TO temp.txt DELIMITED

works fine, but the

APPEND FROM temp.txt TYPE DELIMITED

can't even pass the compile process...


==================================

EDIT: never mind and forget it, JPARADA show me the right way*, thank you.

* http://hmgforum.com/viewtopic.php?f=24& ... TED#p10950
Attachments
append_from.PNG
append_from.PNG (18.22 KiB) Viewed 11404 times
User avatar
Jairo Maia
Posts: 53
Joined: Sun Jul 17, 2011 1:47 pm
Location: Campinas - SP - Brazil

Re: APPEND FROM DELIMITED WITH other char not comma ARE NOT

Post by Jairo Maia »

Czarny_Pijar wrote:APPEND FROM temp.txt TYPE DELIMITED
can't even pass the compile process...
Can't have the TYPE. Try in this way:

Code: Select all

APPEND FROM temp.txt DELIMITED
Post Reply