2

I need a text editor which tells me the position of the cursor (so I can determine ranges of text to then load into strings). Unfortunately the text editors ive tried (TextWrangler, Aquamacs, EditPad) only tell me the line number the cursor is on, and the character index on that line. I need the index from the beginning of the file to that point - ie the absolute index. Any recommendations for an editor (or a technique im missing in the editors ive already got) which can tell me this?

Giovanni
  • 850
  • 3
  • 14
  • 32

3 Answers3

4

If you select some text in TextWrangler you will find 3 numbers at the bottom right of the screen. The first says how many characters are selected, the second how many words and the last how many lines. If you select everything from the beginning of the file until the position you are interested in, the first number will give you what you want.

TextWrangler bottom right

Vortexfive
  • 1,889
  • 13
  • 19
1

Emacs and Vim tell you. If you have Aquamacs, it's probably just as case of setting it up to show in your modeline:

enter image description here

As you can see - my modeline shows that the caret is on line 3, column 8 -> the (3,8)

Abizern
  • 146,289
  • 39
  • 203
  • 257
0

Just as the above answers show, you can drop a string in Notepad or Notepad++ and view the position.

Bottom Notepad Image

William Humphries
  • 541
  • 1
  • 10
  • 21