Hi Martin,
Thanks for your reply. I can do what I want with the command you supplied.
However, I don't know how to insert the regexp into my current macro. I am
not a developer. I use TextMate for one specific purpose: to change the
format of audio timecodes to a syntax that is compatible with an online
learning system. It takes a list of Start and End times that look like this:
0'24.9951 Start
0'31.9160 End
0'37.7354 Start
0'47.3503 End
and does the following: adds a leading digit to the first pair, replaces the
"'" with a ":", and replaces the "." with a
":", and deletes the TAB-Start
and TAB-End. I also need it to delete the last character of each line, so I
end with a list like this:
00:24:995
00:31:916
00:37:735
00:47:350
I was able to cobble together a macro that does everything but remove the
last digit. I use a series of findWithOptions commands. I have attached the
macro I use. What would I need to add to this macro to delete the last
character of each line?
Thank you so much for your help.
Keith
http://old.nabble.com/file/p32273825/Replace.tmMacro Replace.tmMacro
Martin Kühl-3 wrote:
On Mon, Aug 15, 2011 at 22:41, kravnh <kjed(a)comcast.net> wrote:
I have written a bundle (a macro actually) that
edits a file by
finding/replacing characters. However I want to add the functionality for
it
to also delete the last character of each line of the document. I tried
using the command moveToEndOfParagraph and DeleteBackward, but it only
deletes the last character of the last line of the document. What
command(s)
would I use for the macro to delete the last character of every line? The
number of lines in the document will vary, so I cannot put a hard line
count
into the macro.
Create a macro that regexp-replaces ".\n" with "\n".
Or just use a command instead of a macro, say with `sed 's/.$//'`.
HTH,
Martin
_______________________________________________
textmate mailing list
textmate(a)lists.macromates.com
http://lists.macromates.com/listinfo/textmate
--
View this message in context:
http://old.nabble.com/Need-help-editing-a-bundle-tp32266863p32273825.html
Sent from the textmate users mailing list archive at
Nabble.com.