G'Day,
Attached is my "Russian District Award List" for Logic 9. Just import the attached DBF file using Tools, Setup, List of valid values, and Import List.
To creare the list, I took the WWW reference that Dennis posted, wrote a small AWK script to process the file like this ...
Quote:gawk -f parse.awk <"Russian District Award rda_eng.txt" >rda.txt
... and imported the output into Logic using Tools, Advanced, Database Commands like this ...
Quote:use lists
append from C:\Users\peter\Documents\Logic9-Data\rda.txt delimited with TAB
replace deleted with .T. for 'DELETED'$DESCR AND FIELD_NAME='RDA'
To actually use this list in Logic, one needs to create a user-defined field called "RDA", and associate it with the "RDA List of valid values", and add the ser defined field to a Log form.
For those interested in doing similar things, here is my AWK/GAWK program ...
Quote:
/.*\s*\([A-Z][A-Z]\)\s*.*$/ { # District header line?
line=$0;
sub(/^ */, "", line);
match(line,/^\s*(.*)\s*\(([A-Z][A-Z])\)\s*(.*)$/,arr); # Break out the data - remember some for code lines
prefix = toupper(arr [2]);
call = toupper(arr[3]);
sub(/^[\t ]*/, "", call); # Remove leading spaces
sub(/[\t ]*$/, "", call); # Remove trailing spaces
descr = toupper(arr[1]);
sub(/^[\t ]*/, "", descr); # Remove leading spaces
sub(/[\t ]*$/, "", descr); # Remove trailing spaces
district = "^(" prefix "-[0-9]*)\\s*(.*)$"; # Remember code prefix
}
$0 ~ district { # district code line
match($0,district,arr); # Break out the data
print "RDA\t" toupper(arr[1]) "\t" toupper(arr[2]) " (" descr " - " call ")"; # Create CSV line for Logic
}
... and you can find information on using AWK/GAWK at
AWK/GAWK Tools for Windows. This material also includes explanations of the "regular expressions" used in the program to assemble the "codes" from the text in the file.
Lists published on the Internet of this sort are usually created by hand, and contain all the usual human errors and ommissions. To process this file, I had to remove various lines with nothing but spaces, edit some lines with dozens of trailing spaces, and remove the surpurflous header lines at the start of the file. No changes were made to the actual data. My raw data file is attached for those who want to process the file themselves using AWK/GAWK.
Peter VK4IU
File Attachment(s):
RDA.DBF (1,298kb) downloaded 78 time(s). rda.txt (163kb) downloaded 76 time(s). Peter VK4IU
You can help by posting images of
any errors and including your
Logic version.