Replace tab character with rake task?


I’ve got a bunch of posts with lines that start with a tab character (	), and they look like this:

The first line of a paragraph 

is shown as preformatted text.

rake posts:remap["	","\ "] is not finding anything to remap. Is there a way to replace the tab character?

(Jay Pfaffman) #2


rake posts:remap["\t","\ "]


Are you sure, Jay?

Are you sure you want to replace all string occurrences of 't' with ' '? (Y/n)

I migh end up wi h a lo of missing ee h! :grimacing:

(Jay Pfaffman) #4

No. I’m not sure. But if that’s the message you got, you might try

rake posts:remap["\\t","\ "]


I get an identical confirmation message as with a single backslash.

(Jay Pfaffman) #6

Hmm. Maybe

rake posts:remap['\t',"\ "]


Still the same message…


Perhaps the task needs to be told explicitly to use regex with a type argument?


rake posts:remap["\t","\ ",regex]
Are you sure you want to replace all regex occurrences of 't' with ' '? (Y/n)

But, I am still not sure if this would remove all t characters.