logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Mass delete from Commentfield in Log form
TF5B
#1 Posted : Sunday, May 12, 2013 11:18:42 AM(UTC)
Billi

Rank: Advanced Member

Groups: Registered
Posts: 36
Location: Akureyri Iceland

Was thanked: 4 time(s) in 4 post(s)
I do want to delete from the commentfield in the log form a lot of enteries like this „WAB:SZ 29| WPX:G4|“. Where the WAB square is different from one form to another and also the WPX. And I would like to do this without deleting anything else from the comment field. Is this at all possible?
Your help would be highly apprisiated.
73 Billi TF5B
I am sorry to post this in this part of the forum but for some reason the „Bulk data changes and database commands“ part of this forum is closed to me.
Sponsor
Note: We receive a commission from Amazon when you purchase via this link. It does not affect your cost. Thank you!
vk4iu
#2 Posted : Sunday, May 12, 2013 6:12:00 PM(UTC)
VK4IU

Rank: Advanced Member

Groups: Moderator, Registered, Administrators
Posts: 404
Man
Location: Hodgleigh QLD

Thanks: 6 times
Was thanked: 77 time(s) in 68 post(s)
G'Day Billi,

It is not completely clear from you post eaxctly what you are tying to do. The data looks like it should be in USERFIELDS rather than COMMENTS.

The tools to use are always the same - use Tools, Advanced, Database commands, open a database, and then use a "filter" to select the QSOs, and use a Foxpro function to replace a field, or part of the text in a field, in ALL the selected QSOs.

With the standard tools in Logic, one cannot filter by comparing one QSO with another.

Using a normal log form, can you successfully "filter" to show only those QSOs you want to change?

You can change part of a field with the STRTRAN function. See Help, Advanced, Expressions and Functions. For example use

STRTRAN(COMMENT,"WAB:SZ 29| ","")

in the "replace with" section to remove "WAB:SZ 29 |" from the COMMENT field of a QSO

Can you be a little more specific as to what you want to change? Can you describe again "the filter" you want to use to show the QSOs you want to change?

Take a backup of your log before, at each step, and after you do a mass update to your log. It is very easy to damage your log when using these techniques. One cannot have too many backups of your log.

Peter VK4IU
Peter VK4IU
You can help by posting images of any errors and including your Logic version.
TF5B
#3 Posted : Monday, May 13, 2013 4:56:27 AM(UTC)
Billi

Rank: Advanced Member

Groups: Registered
Posts: 36
Location: Akureyri Iceland

Was thanked: 4 time(s) in 4 post(s)
Hello Peter and thank you for your reply.
I will try to explain this a bit better but english is not my first language so ber with me there.
I know that the data should be in userfields and that is where it is now but it is also in the commentfield from a long time ago and that is what I want to delete.
I have been using LOGIc since it was a DOS software and have put warius info in the commentfield which now can be put in to userfields.
What I would like to do is to delete all the WAB squares from the comment field in all the qso´s in my log without delete anything else from the commentfield not just SZ 29 and the same goes for WPX this info is now in userfields.
There is no problem to filter those QSO´s from the log With the following "Field name "Comment" Operator "$"(contains)Value "WAB"" this will filter out all qso´s with the letters WAB in the comment field an gives me abt 763 qso´s and the WPX filter gives my abt 21000 qso´s.
I do hope that this explains my intensions a bit.

73 Billi TF5B
vk4iu
#4 Posted : Monday, May 13, 2013 4:46:50 PM(UTC)
VK4IU

Rank: Advanced Member

Groups: Moderator, Registered, Administrators
Posts: 404
Man
Location: Hodgleigh QLD

Thanks: 6 times
Was thanked: 77 time(s) in 68 post(s)
Thanks for adding that Billi.

Wow ... you are the longest serving user of Logic I have had the pleaseure to talk to. I started only with version 4 and Windows.

I now see more clearly what you want to do. It will not be so easy - the data will be very different in each record, and the tools we can use are limited.

What version of Logic are you using? There was a change made in the composition of a user field - spaces were removed - to save space in USERFIELDS.

I suggest multiple passes over the log, removing an "old user field" from the comment field - one field at a time.

Are you now using version 9?

I shall do some experimenting

Peter VK4IU
Peter VK4IU
You can help by posting images of any errors and including your Logic version.
vk4iu
#5 Posted : Monday, May 13, 2013 5:26:10 PM(UTC)
VK4IU

Rank: Advanced Member

Groups: Moderator, Registered, Administrators
Posts: 404
Man
Location: Hodgleigh QLD

Thanks: 6 times
Was thanked: 77 time(s) in 68 post(s)
G'Day again Billi,

I ran some tests.

Make a backup before you try this.

A little test first, to make sure it can work. Locate a QSO that has a COMMENT that contains the data you want to remove. Note the call sign.

Open Tools, Advanced, Database commands ...

use log
browse for "call"$log.call

... where "call" is the call you noted above. You should see the QSO displayed. If there is more than one, just move up and down to select the one with the data in the comment field.

Close that window and type ...

? tag_edit(log.COMMENT,"WAB:","")

... and that should print the comment without the WAB tag.

If that did not work, post a reply here with the line that was printed.

If that did work, open Database Files, Mass Change, Replace field contents

Select COMMENT in the "Replace this feid"
Enter 'tag_edit(COMMENT,"WAB:","")' in the "with" panel

In the "Replace only" panel enter "WAB:"$COMMENT".

Click the "count" button to check that you have filtered the correct number of QSOs.

If you think all is OK, Click OK - and the WAB: tag should be removed from the COMMENT field of all the selected QSOs.

Repeat the process for each tag you want to remove from the COMMENT field. Or, look at my next post to see how to do more than one tag at a time.

Peter VK4IU
Peter VK4IU
You can help by posting images of any errors and including your Logic version.
vk4iu
#7 Posted : Monday, May 13, 2013 5:37:51 PM(UTC)
VK4IU

Rank: Advanced Member

Groups: Moderator, Registered, Administrators
Posts: 404
Man
Location: Hodgleigh QLD

Thanks: 6 times
Was thanked: 77 time(s) in 68 post(s)
... if you want to remove multiple tags from the COMMENT field of each QSO, use the following line ...

tag_edit(tag_edit(COMMENT,"WPX:",""),"WAB:","")

in the "with" panel of the Mass Change, Replace field contest dialogue. That would remove TWO tags. For three tags use ...

tag_edit(tag_edit(tag_edit(COMMENT,"XXX:",""),"YYY:",""),"ZZZ:","")

... and so on.

Explanation ....

If the third value of the TAG_EDIT function is "nothing", the tag is deleted. The tag_edit function returns the new value of the field from which the tag was removed. So we can "nest" calls to tag_edit, one winthin the other, to remove multiple tags.

See Help, Advanced, Expressions and Functions for other handy functions.

Peter VK4IU
Peter VK4IU
You can help by posting images of any errors and including your Logic version.
TF5B
#6 Posted : Tuesday, May 14, 2013 7:35:49 AM(UTC)
Billi

Rank: Advanced Member

Groups: Registered
Posts: 36
Location: Akureyri Iceland

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: vk4iu Go to Quoted Post
G'Day again Billi,

I ran some tests.

Make a backup before you try this.

A little test first, to make sure it can work. Locate a QSO that has a COMMENT that contains the data you want to remove. Note the call sign.

Open Tools, Advanced, Database commands ...

use log
browse for "call"$log.call

... where "call" is the call you noted above. You should see the QSO displayed. If there is more than one, just move up and down to select the one with the data in the comment field.

Close that window and type ...

? tag_edit(log.COMMENT,"WAB:","")

... and that should print the comment without the WAB tag.

This command did print without the WAB tag

If that did not work, post a reply here with the line that was printed.

If that did work, open Database Files, Mass Change, Replace field contents

Select COMMENT in the "Replace this feid"
Enter 'tag_edit(COMMENT,"WAB:","")' in the "with" panel

In the "Replace only" panel enter "WAB:"$COMMENT".

Click the "count" button to check that you have filtered the correct number of QSOs.

If you think all is OK, Click OK - and the WAB: tag should be removed from the COMMENT field of all the selected QSOs.

I did try this and did copy the commands from your mail in to the database commands on my computer and it did not work.
The counter did not show me anything and when I did click on OK I got this message: Command contains unrecognized phrase/keyword


Any Ideas? 73 Billi TF5B

Repeat the process for each tag you want to remove from the COMMENT field. Or, look at my next post to see how to do more than one tag at a time.

Peter VK4IU

vk4iu
#8 Posted : Tuesday, May 14, 2013 3:09:00 PM(UTC)
VK4IU

Rank: Advanced Member

Groups: Moderator, Registered, Administrators
Posts: 404
Man
Location: Hodgleigh QLD

Thanks: 6 times
Was thanked: 77 time(s) in 68 post(s)
... do not inlcude the single quotes around the code. Just ...

tag_edit(COMMENT,"WAB:","")

and

"WAB:"$COMMENT

Peter VK4IU
Peter VK4IU
You can help by posting images of any errors and including your Logic version.
1 user thanked vk4iu for this useful post.
WN4AZY on 5/16/2013(UTC)
TF5B
#9 Posted : Wednesday, May 15, 2013 6:47:55 AM(UTC)
Billi

Rank: Advanced Member

Groups: Registered
Posts: 36
Location: Akureyri Iceland

Was thanked: 4 time(s) in 4 post(s)
Hi Peter.
This did the trick.

It did find all the WAB enteries but did not delete abt 63 of them or so.
I did try warius versions of the filter and the entries where found but not deleted so I deleted them by hand.

The WPX enteries was found and deleted all 20.999 of them in one go.
The reason for this difference between WAB and WPX might be that the WPX entri was always the same prefix WPX: but WAB was not always the same like WAB: or WAB- or WAB and WAB and a space.

I would like to thank you for all your help with this and I have learned a bit more abt LOGic.

By the way I am using LOGIc 9 the latest version.

73 from Akureyri Iceland Billi TF5B
vk4iu
#10 Posted : Wednesday, May 15, 2013 3:35:06 PM(UTC)
VK4IU

Rank: Advanced Member

Groups: Moderator, Registered, Administrators
Posts: 404
Man
Location: Hodgleigh QLD

Thanks: 6 times
Was thanked: 77 time(s) in 68 post(s)
G'Day,

Your very welcome Billi. I too, learn a little more each time I help.

Yes, TAG_EDIT, and the other tag functions TAG_zzzz, will be looking for the "standard form" of the tag, that is "xxx: yyy|", and would not have found the other non-standard forms.

Peter VK4IU
Peter VK4IU
You can help by posting images of any errors and including your Logic version.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.065 seconds.