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

Notification

Icon
Error

Long Filter Expression in Export function
DL6JZ
#1 Posted : Monday, December 5, 2016 1:49:56 PM(UTC)
Rank: Member

Groups: Registered
Posts: 13
Location: Dresden

I want to export log data with a filter expression like this:
QSO_DATE>{^2016-10-30} AND (TAG_VAL("ARLHS:", USERFIELDS, "C")<>'' OR TAG_VAL("GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("IOTA:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_WCA:", USERFIELDS, "C")<>'' )
But the box "Select criteria, blank for all" in the Export window is to small. After CTRL-V the expression is cut before it ends and there ist no chance to edit.
This expression can not built with the expression builder since there ara AND and OR in the same expression.
What did I wrong or what can I do?
73
Wolf, DL6JZ
Sponsor
Note: We receive a commission from Amazon when you purchase via this link. It does not affect your cost. Thank you!
w2zi
#2 Posted : Tuesday, December 6, 2016 7:57:36 PM(UTC)
Rank: Advanced Member

Groups: Registered
Posts: 180
Man
Location: Daytona Beach, Florida

Thanks: 48 times
Was thanked: 67 time(s) in 62 post(s)
Try using Tools -> Advanced -> Database commands
Craft the command there as it does not have the same limitation.

73s, Don
1 user thanked w2zi for this useful post.
WN4AZY on 12/11/2016(UTC)
DL6JZ
#3 Posted : Wednesday, December 7, 2016 4:41:47 PM(UTC)
Rank: Member

Groups: Registered
Posts: 13
Location: Dresden

Hello Don,
thank you for your answer. But I am very sorry. I am not smart enough to do so. I know a bit SQL. And I made a lot of successfull replace commands on my 100,000 imported QSO records because I found this command in the menu of the Database Command function.
But what is the right syntax of the SELECT statement? And what is the command to export an ADIF-file?
73
Wolf, DL6JZ
w2zi
#4 Posted : Friday, December 9, 2016 12:17:16 PM(UTC)
Rank: Advanced Member

Groups: Registered
Posts: 180
Man
Location: Daytona Beach, Florida

Thanks: 48 times
Was thanked: 67 time(s) in 62 post(s)
Wolf,
I can only give you partial help on this.

LOGic is not SQL based. The commands available are similar. HOWEVER, you only have access to an interpreted subset as can be distributed with a complete application. The ADIF file format needs to be generated with a program (.PRG) or from the internal executable.

Exporting the data is easy enough if you want to manipulate it outside of LOGic. This is all I've ever used and then imported in Excel.
Go to the database command window:
use log
copy all to out.csv delimited

This will create a dump of the entire log.

LOGic does provide a way to write programs which could do the task but that's beyond any help I can provide.
There is a subfolder in the installation directory called 'util'
You can look at the programs there and may be able to write what's needed.

73s, Don
1 user thanked w2zi for this useful post.
WN4AZY on 12/11/2016(UTC)
DL6JZ
#5 Posted : Saturday, December 17, 2016 10:25:38 AM(UTC)
Rank: Member

Groups: Registered
Posts: 13
Location: Dresden

Hello Don,

your hint about the util-folder is very useful for me. I think I will be able to adapt the code.

73
Wolf, DL6JZ
DL6JZ
#6 Posted : Thursday, December 22, 2016 5:40:41 PM(UTC)
Rank: Member

Groups: Registered
Posts: 13
Location: Dresden

Hello Don,

I am sorry. But
Tools --> Advanced --> Database Commands
has the same limitations. It is not possible to select 11 fields into one logical expression. Terrible!!!
Is it a limitation of FoxPro or is it a limitation of the expression builder of Logic 9? I am a bit surprised! And at least the expression windows are much to small.
Merry christmas
Wolf, DL6JZ
w2zi
#7 Posted : Friday, December 23, 2016 9:55:30 AM(UTC)
Rank: Advanced Member

Groups: Registered
Posts: 180
Man
Location: Daytona Beach, Florida

Thanks: 48 times
Was thanked: 67 time(s) in 62 post(s)
Hello Wolf,

I do not know what the limits are in Database commands.

Since you want to generate an ADIF format file, I suggest you focus on writing a .PRG file.
You should put it in the ..\util directory and execute it with Tools -> Miscellaneous utilities.

Since you want to generate an ADIF file, writing a .PRG program should be your choice. You can research
the file structure on ADIF (currently at version 3.0.4) though LOGic only generates version 2 files as that's
all you really need.

If you really hit a limit within a .PRG file, consider a partial SELECT expression, exporting to an
intermediate file, then use that file and complete the SELECT.

Another approach since you said you knew a little SQL, Microsoft offers SQL Server Express which is free.

OR, if you have access to Microsoft Office (or Libre Office or Google Docs), consider exporting
the whole log (CSV) and then manipulating it there.

Hope some of that helps.

73s, Don
WN4AZY
#8 Posted : Sunday, December 25, 2016 8:59:24 PM(UTC)
admin

Rank: Administration

Groups: Administrators, Beta Testers
Posts: 3,097
Man
Location: Auburn, GA

Thanks: 998 times
Was thanked: 497 time(s) in 412 post(s)
LOGic uses the Foxpro expression engine, and I can't find any documentation on any limitations.

I tested with this (the expression given in your first post), which is 243 characters, and it works:
QSO_DATE>{^2016-10-30} AND (TAG_VAL("ARLHS:", USERFIELDS, "C")<>'' OR TAG_VAL("GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("IOTA:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_WCA:", USERFIELDS, "C")<>'' )

I tried these commands in Database Commands:

use log

BROWSE FOR QSO_DATE>{^2016-10-30} AND (TAG_VAL("ARLHS:", USERFIELDS, "C")<>'' OR TAG_VAL("GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("IOTA:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_WCA:", USERFIELDS, "C")<>'' ) AND QSO_DATE>{^2016-10-30} AND (TAG_VAL("ARLHS:", USERFIELDS, "C")<>'' OR TAG_VAL("GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("IOTA:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_WCA:", USERFIELDS, "C")<>'' ) AND QSO_DATE>{^2016-10-30} AND (TAG_VAL("ARLHS:", USERFIELDS, "C")<>'' OR TAG_VAL("GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("IOTA:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_GMA_REF:", USERFIELDS, "C")<>'' OR TAG_VAL("MY_WCA:", USERFIELDS, "C")<>'' )


(ANDed the expression together twice), making it nearly 750 characters, and it is OK.

Please send me the exact command you are using so I can try it here. I expanded the Export field to handle longer expressions (using the one in your first post). Perhaps I need to make it longer?

Merry Christmas & 73,

Dennis WN4AZY
DL6JZ
#9 Posted : Monday, January 9, 2017 7:03:17 AM(UTC)
Rank: Member

Groups: Registered
Posts: 13
Location: Dresden

Hi Dennis,

happy new year to You and to Yours. I have to apologize for my posting which was not very correct. The limitation of the string length exists in the small windows

"Export" (Tools --> Export log data --> ADIF, XML, xBase, ASCII and other generic formats)
and
"Replace field contents" (Tools --> Advanced --> Database commands --> Database files --> Mass change --> Replace field contents)

only. But not in the big window "Command" inside the Database commands tool.

But I found a better way to solve my problem. Since I need the same long expressions quite regularly I make .prg-files and compile them.

I am very new to Logic and I am in the beginning of my learning curve. By the way I am very impressed by the performance of the database engine. There are a bit more than 100,000 QSOs in my log and it takes no measurable time to execute the database commands.

73
Wolf, DL6JZ
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.048 seconds.