> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loqate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GKRInfo Tool

Each GKR file has a set of parameters and corresponding values. The GKRInfo process is designed to provide information about the GKR files' parameters. The GKR files are read from the data folder provided.

## API Usage

The following code walks through API usage.

### Initialize the server

```java theme={null}
lqtServer srv = lqtServer.create();
srv.init("C:\\loqate\\data");
lqtProcessList lst = lqtProcessList.create();
lqtProcessOptions opts = lqtProcessOptions.create();
```

### Set the tool

```java theme={null}
lst.add("GKRInfo", opts);
```

### Execute the process

```java theme={null}
lqtInputRecord rec = lqtInputRecord.create();
lqtProcessResult res = lqtProcessResult.create();
srv.process(rec, lst, res);
```

### Dump the output from the GKRInfo

```java theme={null}
FileWriter outputFile = new FileWriter("C:\\output.txt");
PrintWriter out = new PrintWriter(outputFile);
for (int record = 0; record < res.getCount(); record++)
{
    out.print( "\n");
    for (long field=0; field < res.getFieldCount(record); field++)
    {
        out.print( res.getFieldName(record, field) + ": " +"\t");
        out.print( res.getField(record, field) + "\n");
    }
}
```

## Output Information

The GKRInfo tool enumerates data files in the data folder and collects all GKR parameters and their values. Each data file's information is stored in a separate Record inside the ProcessResult structure.

### Common Parameters

| Parameter                    | Description                                                                                          |
| ---------------------------- | ---------------------------------------------------------------------------------------------------- |
| `Name`                       | Name of the data file                                                                                |
| `DataVersion`                | Release version                                                                                      |
| `GKRVersion`                 | Version number of data format                                                                        |
| `Reference.FieldCount`       | The fields that have available data in the Reference data file for the specific country              |
| `Reference.ContentType.()`   | The actual fields                                                                                    |
| `Reference.FieldBlank.()`    | Count of records where the particular field is blank (output for each relevant field)                |
| `Reference.FieldDistinct.()` | Count of records where the particular field is unique and not blank (output for each relevant field) |

Most other parameters vary by file and provide miscellaneous information about the respective files.

### Example Output

The following example shows parameters and values for `context.lfs`:

```
Name                        context.lfs
CompressionType             0
Context.MaxNodeSize         256
Context.NodeLookupPos       2036
Context.RecordLookupPos     167805
File.Build.Context          1357346307
File.Version.Context        1
DataVersion                 2013Q1.0
GKRVersion                  1
```
