Search code examples
unixfix-protocol

How to get pipe (|) delimiters between FIX tags in a UNIX command for FIX logs?


I am able to get spaces between tags by running:

tail -f filename | tr '\001' ' '

but I would like the tail output to have | delimiters, i.e.

35=D|49=sender|56=recipient

anyone know how? thanks


Solution

  • Don't you simply want this?

    tail -f filename | tr '\001' '|'
                                  ^
                                  replace space with pipe!
    

    \001 is ASCII character 1, also known as SOH ("start of heading"). FIX uses this character as the field separator, i.e. it follows every "tag=value" element.

    The unix tr command simply replaces all instances of the first parameter (\001 above) with the second parameter (|).