Page 1 of 1

Lister: Cursor position

Posted: 2013-12-30, 16:34 UTC
by zeroreality
Hi, long time user, first time poster.
I've looked at several threads here which all focus on line/character position, but nothing about cursor position within a document.

The only "jump to" available in Lister seems to be the % based one you get to by clicking the % in the toolbar in the upper right corner. I'd love to see the cursor position available in addition to the % through the document. (adding decimal percent value parsing instead of just integer would also be helpful :D).

This is not about line position since that would require reading the whole file (from beginning at least) to count the \n or \r characters. I'm talking about the actual cursor's stream position, or carrot's selected range indexes within the stream.

I am currently working with a giant (467gb) XML file (the unpacked "planet" file from OpenStreetMap) and being able to get the stream position from Lister would be super helpful. I wrote a simple file reader/prosessor where I can specify the streamreader's start position, and it would be great if I could get this inf out of lister so I don't need to search for it using my own application.
Example: if I'm 17% through my file, the the cursor position would be something around ~79,463,300,000.

Thank you,

Posted: 2013-12-30, 18:23 UTC
by MVV
I agree that floating poing percent number would be useful. Also TC may show exact percent position with fractional part in 'go to %' window instead of empty field.

Posted: 2013-12-31, 09:59 UTC
by ghisler(Author)
Lister does NOT know the current line of the cursor! It's because it only loads a small block of data around the current position into memory, and find line breaks dynamically. This is done so large files can be displayed immediately.

To find out the current offset, just switch to hex mode (press 3). You can use calc.exe to convert the hex value to decimal.

Posted: 2013-12-31, 11:52 UTC
by MarcinW
zeroreality and MVV are talking about an offset in file, rather than a line number.

Posted: 2014-01-06, 18:53 UTC
by zeroreality
ghisler(Author) wrote:Lister does NOT know the current line of the cursor! It's because it only loads a small block of data around the current position into memory, and find line breaks dynamically. This is done so large files can be displayed immediately.

To find out the current offset, just switch to hex mode (press 3). You can use calc.exe to convert the hex value to decimal.
I didn't think about the hex view, but that will work for me in a pinch.
Thanks!

Posted: 2014-01-06, 22:36 UTC
by Balderstrom
You could look at EmEditor, if you actually wanted to edit the file.
Large File Controller wrote:EmEditor is abble to open files larger than 248 GB by opening a portion of the file with the custom bar - Large File Controller. The Large File Controller allows you to specify the beginning point, end point, and range of the file to be opened. It also allows you to stop the opening of the file and monitor the real size of the file and the size of the temporary disk available.

Lister: Cursor position

Posted: 2014-03-02, 12:49 UTC
by rif
Could the %-position in Lister be extended to:

1. Show the file position as KB/MB/GB position?

2. The jump-to feature would allow to type in not just %-position but also as KB/MB/GB or as hex address?

On the jump-to dialogue the text input field could actually be made to accept all:
42% - procent position
23.4M - some 23.4 mega-bytes file position (*1)
$a8c or 0x0a8c - file position in hex
7000 - line number (would require file scan)

(*1) Whether K/M/G/T means 1000 or 1024 should just follow what is done elsewhere in TC.

Posted: 2014-03-02, 13:09 UTC
by MVV
That would be really useful to specify absolute position in size units or as hex offset!

Posted: 2014-03-02, 13:43 UTC
by MarcinW
I support this idea, absolute positions (as decimal or hexadecimal) would be great.

Posted: 2014-03-06, 06:31 UTC
by ado
MVV wrote:That would be really useful to specify absolute position in size units or as hex offset!
really great idea
0x400 (or simply 1k) - jump to 1k from the beginning
+0x400 (or +1k) - go 1k forward
-0x400 (or -1k) - go 1k backward
and of course as MarcinW mentioned, to have an option to use hex or decimal

...jump by line number - it would be not only slow, but would also require to display line nr, and that would lead to inconsistency (display it only sometimes) of slowness of lister. To not bother with line numbers is one of great decisions that author did when he started with WC and I'd say it should stay like that.

ado