Closed mattjj closed 10 years ago
:thumbsup:
I clobbered this, can you re apply?
So you only changed the comments in the file headers, it looked like? (I only checked smFRET.m)
Not exactly, but I now realize I didn't do exactly what I intended either. I wrote my sed command to affect only lines whose first character was '%', so it didn't affect any of the indented comments.
Just so you know, this command
find . -iname '*.m' -exec gsed -i -E 's/^%([^ \t%])/% \1/' '{}' \;
In English says "find all the files that end with '.m' and for each one run it through this sed program", where the sed program 's/^%([^ \t%])/% \1/'
says substitute every line that has a % as its first character and then some stuff that is not a space, tab, or percent character immediately after with a line that has a % and then a space and then all that other stuff.
I'm going to run this command now:
find . -iname '*.m' -exec gsed -i -E 's/^([ \t]*)%([^ \t%])/\1% \2/' '{}' \;
which is like the old one except it will get indented comments, too.
There are still lines like these:
DNANeighborhood = 9^2;%Same as BeadNeighborhood but for DNA.
but I want to be careful not to screw up any print formatting strings... maybe I'll run something that looks for semicolons and then check the results manually to be sure it doesn't screw anything up.
Here's what I just ran:
find . -iname '*.m' -exec gsed -i -E 's/; ?([ ]*)%([^ \t%])/;\1 % \2/' '{}' \;
OK that's what I'd figured (that it didn't catch indented comments). thanks!
(duplicate of #3, but after purging the data)
The comments didn't have whitespace after the comment character, so they were hard to read and didn't conform to Matlab help style or Matlab comment style or the style of any language known to man.
I revised them by running this command
where my gsed points to a version of gnu sed.