Unescpaing huge single-line string on Linux
Posted
by Lajos Nagy
on Stack Overflow
See other posts from Stack Overflow
or by Lajos Nagy
Published on 2010-05-11T22:26:38Z
Indexed on
2010/05/11
22:34 UTC
Read the original article
Hit count: 275
I ended up with a huge, single line string literal (don't ask me how) where everything is escaped (mostly), including new lines and double quotes. Problem is, I want the original string. The string is huge so I'm not even sure how to begin. Here's what I have:
"This\n is \"nice\",\nain\'t it?"
This is what I want:
This
is "nice",
ain't it?
Again, the problem is that other shell sensitive stuff is not escaped (like $, or !), and that the string is couple of megabytes.
© Stack Overflow or respective owner