How to search and retrive a value

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
esgici
Posts: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 247 times
Been thanked: 91 times
Contact:

Re: How to search and retrive a value

Post by esgici » Sun Dec 03, 2017 1:58 pm

RPC wrote:
Sun Dec 03, 2017 7:03 am
...
it is not two cents worth but two million dollar worth of code for me.
Another way of processing text file. I love it.
...
Hi Rajeev

Many thanks to your nice words for me :)

But please do not exaggerate, it was only a humble work for friends :oops:

By the way; if you want we can raise the bar:

for example converting a CSV ( or DSV ;) ) file to .dbf;

what is your opinion ?

Regards
Viva INTERNATIONAL HMG :D

jayadevu
Posts: 204
Joined: Tue May 19, 2009 7:10 am
Been thanked: 3 times

Post by jayadevu » Sun Dec 03, 2017 4:59 pm

Very nice code Esgici.

Warm regards,

Jayadev

User avatar
esgici
Posts: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 247 times
Been thanked: 91 times
Contact:

Post by esgici » Sun Dec 03, 2017 5:04 pm

jayadevu wrote:
Sun Dec 03, 2017 4:59 pm
Very nice code Esgici.
...
Thanks Jayadevu;

just your grace :D

Regards
Viva INTERNATIONAL HMG :D

RPC
Posts: 119
Joined: Fri Feb 10, 2017 4:12 am
Has thanked: 28 times
Been thanked: 6 times

Post by RPC » Mon Dec 04, 2017 11:27 am

esgici wrote:
Sun Dec 03, 2017 1:58 pm
RPC wrote:
Sun Dec 03, 2017 7:03 am
...
it is not two cents worth but two million dollar worth of code for me.
Another way of processing text file. I love it.
...
Hi Rajeev

Many thanks to your nice words for me :)

But please do not exaggerate, it was only a humble work for friends :oops:

By the way; if you want we can raise the bar:

for example converting a CSV ( or DSV ;) ) file to .dbf;

what is your opinion ?

Regards
Many thanks for offering help to convert from CSV to DBF.
At present I am interested in getting just one value from CSV file.
I will certainly ask in case I am interested in CSV to DBF conversion,
thanks
With Best Wishes

User avatar
esgici
Posts: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 247 times
Been thanked: 91 times
Contact:

Post by esgici » Mon Dec 04, 2017 3:01 pm

RPC wrote:
Mon Dec 04, 2017 11:27 am
...
I will certainly ask in case I am interested in CSV to DBF conversion,
...
OK, I will start,

please remain in line ;)

Regards :D
Viva INTERNATIONAL HMG :D

RPC
Posts: 119
Joined: Fri Feb 10, 2017 4:12 am
Has thanked: 28 times
Been thanked: 6 times

Post by RPC » Tue Dec 05, 2017 7:04 am


...
please remain in line ;)
...
Ok, I am all eyes and ears. :D

franco
Posts: 213
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 6 times

Post by franco » Tue Dec 05, 2017 7:10 pm

rajeev,
I needed this exact situation and I used rat()
you keep shortening the long string until you get to right comma
local a:=0, b:=longstring, c := 'strwanted'
a:= val(substr(b ,rat(c,b)-1
//here you can make your 6 loops.
b:=substr(b,1,a)
a:=val(substr(b,rat(',',b)-1

// this works for me I can find any point in string or field.
regards Franco ;)

RPC
Posts: 119
Joined: Fri Feb 10, 2017 4:12 am
Has thanked: 28 times
Been thanked: 6 times

Post by RPC » Wed Dec 06, 2017 10:58 am

franco wrote:
Tue Dec 05, 2017 7:10 pm
rajeev,
I needed this exact situation and I used rat()
you keep shortening the long string until you get to right comma
local a:=0, b:=longstring, c := 'strwanted'
a:= val(substr(b ,rat(c,b)-1
//here you can make your 6 loops.
b:=substr(b,1,a)
a:=val(substr(b,rat(',',b)-1

// this works for me I can find any point in string or field.
regards Franco ;)
Thanks Franco.
I will try and report.

User avatar
esgici
Posts: 4363
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 247 times
Been thanked: 91 times
Contact:

Post by esgici » Wed Dec 06, 2017 7:44 pm

RPC wrote:
Mon Dec 04, 2017 11:27 am
...
I am interested in CSV to DBF conversion,
...
Hi Rajeev (and all of course )

As promised:

ScreenShotOf_DSV2DBF.prg.jpg
as name implied ...
ScreenShotOf_DSV2DBF.prg.jpg (43.28 KiB) Viewed 74 times
DSV2DBF.zip
DSV2DBF source files and resources
(5.42 KiB) Downloaded 13 times

Please don't forgive my faults :arrow:

Once again:

HMG is a miracle; built by a genius, thousands of fools couldn't break

Viva HMG :D
Viva INTERNATIONAL HMG :D

RPC
Posts: 119
Joined: Fri Feb 10, 2017 4:12 am
Has thanked: 28 times
Been thanked: 6 times

Post by RPC » Thu Dec 07, 2017 6:48 pm

RPC wrote:
Wed Dec 06, 2017 10:58 am
Thanks Franco.
I will try and report.
Franco
I tried your code and it works like charm :!: and its so simple :D
Many Thanks
I am really thankful to all those who have helped me in this code.

Post Reply