Bumpdate:
A coworker suggested a different approach to the problem, where I should just replace the occurences of \n\t with something else to put all the info for each record on one line, and go from there.
Naturally I looked into sed and/or tr, but I'm having far too much trouble catching the newline with a sed expression, and tr replaces \n and \t separately, as opposed to as one entity.
Ideally I'd like to use:
but for some reason the escape sequences do not seem to work as expected.
I've moved on to a backquoted printf to insert the literal characters into the expression:
Code:
sed "`printf 's/\\\n\t/X/g'`"
which
does work to catch the tab charater, but ignores the newline.
I've realized that this is most likely due to sed's behaviour of reading input one line at a time, without the newline. While I can see this potentially causing a memory issue, is it at all possible to get sed to read the input all in one go, as opposed to line by line?
I am open to other lines of thought as well, should anyone have another method in mind.