View Full Version : stripping control characters in excel
The Fool
1st November 2005, 02:35 AM
I often need to strip control characters from excel spreadsheets for data imports...(tabs carriage returns etc) . I do it at the moment by saving as a text file and sticking it on a unix box to do it....but I reeeeeely would like to be able to do it in windows, preferably in excel. Anyone got any ideas? Know of any little apps that strip control characters from xls cells?
a_unique_person
1st November 2005, 02:58 AM
I'm surprised, given the amount of software on offer to do this, it appears you can't do it simply. A macro would be the way to do it, if VBA is not too daunting.
Which is surprising, since Word has the ability to do this.
BTW, I hear the Japanese make very reliable, cheap, and smooth motorbikes, if you're still looking.
The Fool
1st November 2005, 03:16 AM
I'm surprised, given the amount of software on offer to do this, it appears you can't do it simply. A macro would be the way to do it, if VBA is not too daunting.
Which is surprising, since Word has the ability to do this.
BTW, I hear the Japanese make very reliable, cheap, and smooth motorbikes, if you're still looking.
Its a major pain. I get a bunch of spreadsheets dumped from someones database and have to shoehorn it into ours using the clunky import routine its saddled with. The free text notes fields are littered with every control character imaginable and I need a simple way to replace them with a nice shiny little space...without having to convert and ftp to and from a unix box......otherwise the imported data in our database looks like klingon poetry.
Here's an Idea...you could write me some VB to strip control characters from xls files and I can sell it and keep the money...how about it?
And there is nothing wrong with Japanese bikes but sometimes smooth and reliable is boring :)
SezMe
1st November 2005, 03:36 AM
What is the file type you start with? Can you just dump it to a csv file then reimport it. Should get rid of all the other crap.
mummymonkey
1st November 2005, 03:41 AM
This any use?
http://www.mvps.org/dmcritchie/excel/join.htm#trimall
MRC_Hans
1st November 2005, 06:35 AM
I don't quite understand what you are trying to do. Excel can export spreadsheets in a dozen formats, some of them quite simple (CSV has already been mentioned), can't you use any of those?
Hans
Cleon
1st November 2005, 08:33 AM
Export to CSV.
Run a Perl script to strip out the crap you don't want.
Load into Excel.
Ta-dah.
varwoche
1st November 2005, 09:02 AM
Export to CSV.
Run a Perl script to strip out the crap you don't want.
Load into Excel.
Ta-dah. Good idea however cell comments don't export to csv.
TF, you could save the file as XML and then run a script but that seems like a lot of manual hassle if this is a recurring task. Let me know what version of Excel you are using and I'll see if I can throw a quick and dirty vba routine together.
© 2001-2009, James Randi Educational Foundation. All Rights Reserved.
vBulletin® v3.7.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.