Skip to content

Instantly share code, notes, and snippets.

@ston1x
Last active February 7, 2020 11:01
Show Gist options
  • Save ston1x/c9ca7d049c29b987b36df77633180b69 to your computer and use it in GitHub Desktop.
Save ston1x/c9ca7d049c29b987b36df77633180b69 to your computer and use it in GitHub Desktop.
vim • Humanize FIX message

🏦

Imagine you have a long line of FIX message:

"8=FOO.4.2\u00019=73\u000135=XyZ\u000149=BRKR\u000156=INVMGR\u000134=235\u000152=19980604-07:58:28\u0001112=19980604-07:58:28\u000110=235\u0001"

And you need to humanize it in order to be able to read each field like this:

8=FOO.4.2
9=73
35=XyZ
49=BRKR
56=INVMGR
34=235
52=19980604-07:58:28
112=19980604-07:58:28
10=235

I've made myself a vim command which replaces the u0001 with newlines, you can try it:

command! HumanizeFix :s/\\u0001/\r/g

How to

  • Just add the line to your ~/.vimrc
  • open vim and go to the line where you have the fix message
  • :HumanizeFix

Credits

  • My colleagues showed me how to do that by replacing the u0001 in SublimeText and I decided that I needed a command/shortcut on that
  • Example of the FIX message is taken from here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment