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
You can make it do so by using the pipe character '|'. Pipe is used to combine two or more commands, and in this, the output of one command acts as input to another command, and this command's output may act as input to the next command and so on.
in a FIX message are terminated by a delimiter character. The non-printing, ASCII "SOH" (#001, hex: 0x01, referred to in this document as <SOH>), is used for field termination. Messages are delimited by the “SOH” character following the Checksum field.
One of the most powerful shell operators is the pipe ( | ). The pipe takes output from one command and uses it as input for another. And, you're not limited to a single piped command—you can stack them as many times as you like, or until you run out of output or file descriptors.
The pipe character | is used to connect the output from one command to the input of another. > is used to redirect standard output to a file. Try it in the shell-lesson-data/exercise-data/proteins directory!
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 (|
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With