Monday, 19 September 2011

Always Nice to Overcome a Problem...

...even if you ripped the answer off someone else, and it was a pathetically geeky problem in the first place.

I use Excel for a formatting calculator - to take a bunch of text and remove/add/tweak portions of the text according to certain rules.

The snag is, the output text ends up with extraneous double quotes in it.

You can get round this by pasting to Wordpad and from there to Notepad.

However, it turns out the reason for these quotes is the original text has carriage returns in which Excel is trying to propagate, albeit in a weird, pointless way.

If you add in to your output cell the extra formula: =SUBSTITUTE(A1,CHAR(10),"")

then the phantom carriage returns are transformed into null values, and all works as you'd expect. Wonderfully simple.

No comments: