Looking for a Small Text Scrubber
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I am working with a spreadsheet with several hundred records and I am wanting to expedite the formatting / text scrubbing somehow. I'd love a text scrubber that does the following:

Doesn't need to be anything super fancy, just a JSFiddle or something with a text area to drop text and a button that'll format the text like so:
* auto-format the following on pasting text into a text area
* remove any returns
* replace tabs with spaces
* remove quotation marks with nothing
* "fix spaces", eg if there are more than 5 spaces, become 1 space
* auto-copy the formatted text on change

As an extra, it'd be amazing if there was a way to 1) sort the fields so that they're always formatted for cell splitting from plain text in Google Sheets / Excel, and 2) If a field is blank that it is replaced with something like "NA" so that the spreadsheet's columns aren't mixed up when I go to split the plain formatted text. In other words, sometimes a field is in the wrong column, because as it stands they might be out of order or not in existence. I'd be willing to tip for extended functionality like this.

I'm not sure how complicated something like this would be to put together. Currently I'm using a trial version of an application called Clean Text which expires in a few days and doesn't really do the above as I need.

I'd prefer if it were written in HTML/JS but if it works in something like JSFiddle and I can edit it, it should be okay!

Please let me know if I can provide more info.

Thank you.

awarded to farolanf

Crowdsource coding tasks.

1 Solution

Hey! This looks very close! Is it possible to have it all be on one line, eg not have any returns?
sharper 26 days ago
Something like this? https://jsfiddle.net/cvL4myg5/51/
kostasx 26 days ago
I've updated the solution, please check it out.
farolanf 26 days ago
Hey, yes, thanks!
sharper 26 days ago
Would you be interested in tweaking this some, for a tip? I'm pasting text and occasionally there are words which should be separated by at least 1 space. If it's possible, it'd be an awesome addition to have it not strip/join words (have at least 1 space between them). Thank you. I hope I'm making sense, haha
sharper 26 days ago
I updated so new line is replaced with a space https://jsfiddle.net/farolan/cvL4myg5/66/, please check it out.
farolanf 25 days ago
Great work, thanks again!
sharper 25 days ago