Automate HxCfgFilConverter From Command Line

Hi,

It would be amazing if Hamilton could provide a version of HxCfgFilConverter that I can run from the command line to turn binary-encoded files into ascii.

e.g.
C:\Users\stefa>HxCfgFilConverter.exe deck.lay ascii

Thanks!

1 Like

It may already be capable of doing this Have you checked the “strings” with something like “Process Explorer”?

I’ve found many command line commands using this method.

1 Like

Ill check it out!

You can use COM object of HxCfgFil to load, save and manipulate all these file

Also it is a file of dictionary like structure, you can write code to process it

2 Likes

HXCFGFILLib.HxCfgFile has following functions

  • LoadFile - load from file
  • StoreFile - store ascii file
  • SerializeFile - store to binary file

you can use other functions to read or write value. Use the COM boject you can write a C# app simply with several lines as follow, I also write this tool, you can download it from githup

var cfg = new HxCfgFile();
cfg.LoadFile(@"pcr_L.rck");
cfg.StoreFile(@"pcr_L.rck.txt", 0);
cfg.SerializeFile(@"pcr_L.rck.rck", 0);

I am not familiar with python, I tried to write code to use this COM, but failed. I think it is easier for you to do it in python.

import win32com.client
o = win32com.client.Dispatch("HXCFGFILLib.HxCfgFile")
o.LoadFile("4mlTF_L.rck")
o.StoreFile("4mlTF_L.txt")
2 Likes
def __convert_to_ascii(file):
    process = subprocess.Popen([
        "C:\\Program Files (x86)\\HAMILTON\\Bin\\HxCfgFilConverter.exe",
        "/t",
        file],
        stdout=subprocess.PIPE,
        universal_newlines=True)
    process.communicate()

See repo for source: GitHub - sniprbiome/PyVenus at d6c05bead1c87d58ee01e7e6645f6a59f2f9a2da

2 Likes

I was going to say the same. Thanks @BirdBare :slight_smile:
But nice to know there is a DLL as well.

Has anybody found a way to add the checksum to a file via a DLL? The only way I have found is to use the HSL function in one of the Util libraries.

2 Likes