Moving the cursor inside a file being written.

Is there any way to move the cursor to a specific location in a file that I am editing.
for example:
moveCursor(int row, int col)
moveRight(int col)
moveToEnd(); //Move to end of current rowI know that I can use RandomAccessFile but that only provides skipBytes(int), seek(long), and getFilePointer().
Thanks,
Marcus

I don't know of anything like that in the api, but you could roll your own. You need to know the length of your lines (which I assume you do since it's a RAF). It'll also be easier to keep track of what row and col you're on, so you don't have to recompute it continually (this may not be true depending on the rest of your design).
To move the cursor to a given row and col, you seek to (row * RECORD_LENGTH + col).
To move right, just move the pointer ahead the difference between the current col and the given col.
Moving to the end of the current row is the same as moving right, just with the last row specified.
Add in some bounds checking to make sure you don't go past the end of a row, and you should be good.

Similar Messages

  • Why does moving the cursor peg the cpu in numbers?

    Why does moving the cursor, even by one cell, peg the cpu in numbers?

    Hello
    Before posting yesterdays, I tested with a table of 4435 x 8 cells on the iMac described below.
    I will be more precise than yesterdays.
    Numbers recalculate the entire document after every change. A single new character is sufficient.
    Twenty years ago, AppleWorks designers were kind enough to recalculate only what really needed.
    It seems that new developers are not relying upon intelligence but upon processor's brute force.
    Their code will be efficient … on the machines which will be available within at least five years.
    Alas, at this time there will no longer be compatible with the operating system.
    Given this awful coding, when AutoSave apply, it must write on disk an entire new index.xml file.
    Same thing when Versions apply.
    Under SnowLeopard these two features don't strike.
    If you wish, you may send your 'offending' document to my mailbox so I will be able to check the way it behave here. Don’t worry, I don't take care of what is really stored, only of the doc's behavior.
    Click my blue name to get my address.
    Yvan KOENIG (VALLAURIS, France) jeudi 12 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2

  • Upgraded to FF4 sites were slow loading or not loading at all - then I discovered it downloads if I keep moving the cursor. If I stop moving the cursor the downloading stops or slows to a crawl again.

    Upgraded to FF4 sites were slow loading or not loading at all - then I discovered it downloads if I keep moving the cursor. If I stop moving the cursor the downloading stops or slows to a crawl again. What do I do so no need to keep having to move cursor?THE DOWNLOADING ICON STOPS MOVING UNLESS I KEEP MOVING THE CURSOR AROUND.

    Clear Cookies & Cache
    * https://support.mozilla.com/en-US/kb/Template:clearCookiesCache
    Clear the Network Cache
    * https://support.mozilla.com/en-US/kb/How%20to%20clear%20the%20cache#w_clear-the-cache
    Troubleshooting extensions and themes
    * https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes
    Check and tell if its working.

  • On a certain website the window size has become so huge I cannot use certain features and am unable to reduce the window size myself. It went huge as I was moving the cursor and I have been unable to ajust this. How do I alter screen size manually?

    Sometimes when moving the cursor the window size on certain sites reduces or increases. This happens randomly and I am not able to make it happen to change the size of the screen to my choice. The window on a particular site is now so huge I am unable to use features on there as they do not come into view on my window at all. Please help me on how to control this feature or in other words how do I increase or decrease the window size manually.

    See "Resizing oversize window" - MozillaZine Knowledge Base
    *http://kb.mozillazine.org/Resizing_oversize_window
    There are a couple of extensions tat could also be involved
    <br><small>Please mark "Solved" one answer that will best help others with a similar problem -- hope this was it.</small>

  • Text types along the horizontal border of the text box instead of being written inside of it. What's wrong?

    I created a text box by dragging the horizontal text tool.
    But when I start typing, the text aligns along the upper border of the box instead of being written inside of it.
    It looks like this.
    How can I fix this, so that the text is inserted inside the defined box?
    Much thanks in advance!

    I just figured it out! Can't believe I was this clueless.
    I just had to change the font height back to 100%. Haha

  • Regarding File being written to Appl server

    Hi Pals,
    Can we restrict the size of the file that is being written to the application server through Open dataset or any other command.
    We have a report which selects data based on a given time period.
    The problem we are facing is that even for a period of 1 month the data file written to the appl server is around <b>14-15 GB</b>. Hence we have been asked to split the file that is being written.
    However the other option of reducing the time period of seelction has been ruled out by our clients.
    Please suggest.
    Thanks in advance.
    Rgrds,
    Gayathri N.

    Hi ,
    try like this
          i_maximum_lines = 99999999.
          block_size = 100000.
    do.
          refresh <l_table>.
          v_filect = v_filect + 1.
          write v_filect to v_filecount left-justified.
          fetch next cursor i_cursor
                     appending corresponding fields of table
    *                 <l_table>  PACKAGE SIZE i_maximum_lines.
                      <l_table>  package size block_size.
          if sy-subrc ne 0.
          e_table = i_table-tabname.
          e_dbcnt = sy-dbcnt.
          clear cursor_flag.
          close cursor i_cursor.
          exit.
          endif.
          delta_dbcnt = sy-dbcnt + old_dbcnt.
          old_dbcnt   = sy-dbcnt.
    Regards
    Prabhu

  • I want to have a progress bar monitor and display the progress of a file being opened, How do I do it?

    I have written large files for a report. When I open the files in the VI by pushing a button I want to view the progress of the file being opened. My first thought was to get the file size, some how measure the number of bytes comming out and monitor it on the progress bar. I am unsure about how to do this. If you know of a better way to monitor and disply the progress of an opeing file please let me know.

    If I understand you correct the progress bar is not the problem, it's to get a numeric value indicating the progress...right?
    If so then you could read the file size, preallocate a byte array to hold the file, then read it in chunks and put the chunks into the array using replace array elements...(you could concatinate strings, but that would easily become very memory and speed expensive...)until you have read the entire file. If the file is 20 MB and you want the progress bar to have a resolution of about 1% read it in chunks of 256 KB...For each chunk read, increment the progress bar...
    MTO

  • .SHMDJOXSHM_EXT Files Being Written to /tmp

    Recently, we've noticed files for each our our 11g databases being written to the /tmp directory. The file names are formatted like this: .SHMDJOXSHM_EXT_nnn_sid_nnnnnnnn.
    These files appear sporadically for each database running on a machine, sometimes 100+ a minute. They are binary files.
    We're running 11.1 on Solaris 10 with containers.
    A Google search finds only one occurrence of this situation and Metalink support suggested I pose the question here.
    We're beginning to move our applications to their production environment and it would be good to determine if the cause for these files was of concern.

    Maybe you should raise a incident to the support and show them that this very thread has no response for the last 3 years...
    +-- thread locked, please open your own defining your own environment, thanks --+
    Nicolas.

  • Moving the online redo log files to different location

    We just installed few more drives into our sandbox system and I want to move the online redo log files for better performance.  We've got the SAPARCH directory moved to a different location. 
    Does anyone know how/where I can change the parameters so redo log files are pointed at different drives?  It's not in the <b>init<SID>.ora</b> file...
    Regards,
    Sumit

    Hi Sumit,
    The following link contains information about moving the redo logs:
    http://www.stanford.edu/dept/itss/docs/oracle/9i/server.920/a96521/onlineredo.htm
    Best regards,
    Alwin

  • Trackpoint keeps moving the cursor after I let it go.

    The trackpoint on this e540 keeps moving after I let it go. The issue arrises when I move the cursor downwards - it then moves upwards on its own, sometimes for several seconds. This happens quite often, and when it happens it obviously makes clicking things hard.
    I guess it doesn't matter since I'm returning it anyway because of all the issues.

    Just go on to any site specialising it and find the reversal procedure.
    Huntress, you have no proof this particular person was the person who jailbroke the phone, as such under legal protection not only in the USA, but also in the EU (a very high chance this user hails from either of these places) he/she cannot be held accountable for the past activities of another user and thus if he/she can restore the phone then he/she is entitled to the standard benefits of all other users.
    Although I fully agree with you this if person was the person who did it then they are up a certain creek without a paddle, especially since many jailbreak processes don't have a reliable de-jailbreak process and thus can only blame himself/herself. If not though, user should return it with a face hammer to the person who sold it lol

  • Moving the cursor in LE 9 & Wave size

    hey, im new to LE 9 and wanted to know is there a way to move the cursor with the keyboard arrows like in garageband??? might be a silly question but using the mouse to move 1/4 beat is really getting annoying!
    and my second question is related to the waves of a recording. i wanted to know if it was possible to amplify (or de-amplify) waves with LE 9
    thanks

    hello roy101
    Logic has many key commands, some already set which you can change.
    Logic Express > Preferences > Key commands
    type in 'forward' or 'rewind' to find these commands easily.
    Default for forward by one bar is the period key .
    rewind by default is comma ,
    Set your own by selecting the command click on 'Learn by key label'
    Now type the key command you want to use.
    The Logic tutorial over at macprovideo are very comprehensive and learning Logic very quick and easy. I mention it because you say you are a new user. They ahave 33% discount
    http://www.macprovideo.com/cart/code/10NLE33
    To amplify the wave... Drag the level fader on the channel strip up or insert a Gain plugin on an insert slot on the channel strip. Change the gain.
    All changes made using plugins are non destructive (will not change the original audio file) so you can try out many different effects this way.
    JG

  • Setting the values inside xml file in xmlparsing

    Hi,
    Iu2019ve an xml file without containing any values inside the tags. I need to get the values from the text file and set the values inside the xml file. When I try to set the string variable inside the setValueNode()  using DOM parser, itu2019s not setting any values inside the xml file. 
    Please help me on this..
    Regards
    Vineela

    Hi,
    I am doing conversion from EDIFACT format to xml format.
    I am writing this code using core java. So I am using xmlparsing to convert my data. Iu2019ve one Hash table with me. I need to get the values from there and populate those values into xml file.
    Regards
    Vineela

  • Are files being written when HDV conforms?

    What exactly happens when my HDV sequence conforms for tape? Is anything being written to the HD?
    Thanks!

    Hi there
    My (basic) understanding of this is that upon conform the computer rebuilds the long GOP structure of your shots enbling seamless playback to tape.
    When you shoot HDV each time you record a shot there is a long GOP structure on tape, when you edit you break that structure and your processor has to re-build this on the fly so that you can see what you are doing (this is one reason why monitoring and cutting HDV is not straightforward).
    when you go to tape the processor effectively renders this long gop structure back into place. I'm not sure if its a render written to the HD though.
    As I said thats my understanding, there are loads of people here more qualified than me to comment on this however, so I may stand corrected shortly. In the meantime google "long gop" for more detail.
    best regards
    Andy

  • While moving the cursor on my laptop the page view got smaller and i cannot change it back to normal

    screen view has reduced in size it occurs for no apparent reason when i am navigating the cursor around the screen

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    * http://kb.mozillazine.org/Zoom_text_of_web_pages

  • Moving the cursor to next field after scanning in RF

    Experts,
    We are developing a RF custom transaction for ITSMOBILE.Can any one provide me some info on how to move the cursor to the next input field automatically after scanning the first filed ? is there any setting in the Device or any config missing or any development required for it?
    Thanks in advance

    Pranathi - For instance if you have 3 Input OR Scan fields in a screen, as soon as you scan the value on the first input field, validate it and then set the field property of th einput field to Display Only, then upon ENTER the cursor will automatically go to the next input field. This is in a desktop. THe same will work in the RF Gun as long as the "Auto-Enter" is set up in your RF gun. This is the only setting required in your device and rest all ABAP. Good Luck.
    -Gisk

Maybe you are looking for

  • Mavericks Mail Kernel System Has Run Out of Application Memory

    I have a new Mavericks late 2013 MBP.  When I got the computer, I used Migration Assistant to transfer everything from my late 2008 MacBook to the new MBP.  Now when I launch Mail, my memory use skyrockets and within a minute or so, I get a "run out

  • How do I debug scriptlet code?

    Hi, My code crashes everytime I submit to the page below which as you can tell is a mix of scriptlet code and html (not the best design but that's what I inherited). When I put a breakpoint where it says [breakpoint] (for illustrative purposes), save

  • How to Improve Adobe Flash Player to watch this video

    When I wanted to watch Man City vs Chelsea live stream via http://footballity.blogspot.com/2013/08/man-city-live-stream-free.html , there is a message "You need to improve your Adobe Flash Player to watch this video" so anybody can help me..

  • FTP Server in Labview

    I would like to embed an FTP server into a Labview application. Is there a way to do this?

  • Tactic 3d Rage not turning on anymore after firmware update, PLEASE HELP

    I tried to update my firmware and did not read the instructions carefully, I never unplugged the headset when I updated the firmware of the usb transmitter. so after that my headset was flashing blue, and it was not working, I let it drain out. but n