Hi,
Been using TextMate for a while, but I came across two simple things that I couldn't figure out how to do. FIrst, I had a text file that I had to find a specific character position in the file.. ie. character 2456. There's no way, that I can see, to go to that specific character position. The status bar at the bottom shows lines / character, but not absolute character position.
The second one was, in the same problem, I wanted to combine all the lines in a file into one long line - I couldn't find a "remove line endings" command. How would I do this?
Thanks!
John.
On Mon, Oct 24, 2011 at 7:59 PM, John Tsombakos tsom467@gmail.com wrote:
The second one was, in the same problem, I wanted to combine all the lines in a file into one long line - I couldn't find a "remove line endings" command. How would I do this?
I don't know if there's a shortcut for your first answer, but for this one, I press Command+F (find), enter \n as the text to find, leave replace blank, and check the regular expression box. Then click Replace All.
Mike.
Control-option-Q works in some language bundles to remove line endings.
Adam Merrifield (out of office) seyDoggy vCard: seydoggy.com/vcard seyDesign vCard: seydesign.com/vcard
On 2011-10-24, at 20:12, Mike Boone mike@boonedocks.net wrote:
On Mon, Oct 24, 2011 at 7:59 PM, John Tsombakos tsom467@gmail.com wrote:
The second one was, in the same problem, I wanted to combine all the lines in a file into one long line - I couldn't find a "remove line endings" command. How would I do this?
I don't know if there's a shortcut for your first answer, but for this one, I press Command+F (find), enter \n as the text to find, leave replace blank, and check the regular expression box. Then click Replace All.
Mike.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 25 Oct 2011, at 01:59, John Tsombakos wrote:
I had to find a specific character position in the file.. ie. character 2456. There's no way, that I can see, to go to that specific character position.
Technically this can be done by placing the caret at the beginning of the document then enable Regular Expression in the Find dialog and search for: (?m).{2456}
This basically finds 2456 repeats of “any character” — the leading (?m) is to enable “multi-line mode” where . (the “any character”) also matches newlines.
The second one was, in the same problem, I wanted to combine all the lines in a file into one long line - I couldn't find a "remove line endings" command. How would I do this?
Search and replace. Be sure to have soft wrap enabled though, as TextMate does not deal well with humongously long lines (w/o wrapping enabled).