Setting line position when Reading a file

pls. help.
what class does it sets the line position when you read a specific line of the file?
i used the LineNumberReader.setLinePosition(int) but it does not actually sets the file pointer to the specified line number...

ok.
can it also read as binary?
all japanese characters also are read with dummy characters.
like the LineNumberReader.readLine(), it reads exactly the same.
i want the functionality of RandomAccessFile to set the file pointer and can read the characters with no exception on any language.

Similar Messages

  • Before, when reading PDF files, I was able to copy and paste part of the book. Now it is not possible. I can copy but when pasting gets nothing.  Antes, quando lia arquivos PDF, eu conseguia copiar e colar parte do livro. Agora isso não é possível.

    Before, when reading PDF files, I was able to copy and paste part of the book. Now it is not possible. I can copy but when pasting gets nothing.
    Antes, quando lia arquivos PDF, eu conseguia copiar e colar parte do livro. Agora isso não é possível. Eu consigo copiar, mas quando vou colar o texto, não cola nada.

    Caro Fabiano,
    Obrigado por ter contactado as Comunidades de Suporte Apple.
    Na origem do seu problema podem estar várias causas. Nomeadamente:
    O ficheiro (arquivo) que está a ler pode não ser texto, ou seja, pode ser texto transformado em imagem e exportado como PDF.
    A aplicação de destino (onde está a tentar colar o texto copiado) pode não aceitar a colagem de texto formatado.
    A aplicação que está a utilizar para abrir os ficheiros PDF pode não ser indicada para certo tipo de documentos. Experimente o iBooks, o Dropbox ou até mesmo o seu e-mail.
    No caso de nenhuma destas causas estar na origem do seu problema, forneça, por favor, mais informações sobre a origem do ficheiro (descarga pelo Safari, Mail ou outro) bem como o destino (documento Pages, Keynote ou Numbers ou outra aplicação que não o iWork).
    Atentamente,
    Gonçalo Matos
    Estou aqui para ajudar. Clique no botão "Reply" no caso de ter outra questão ou necessitar de outro esclarecimento para que eu possa ajudar da melhor forma que conseguir.

  • Problems when reading pdf files

    I use windows 7, and also have available Adobe Reader 5 and Adobe Reader X, but i receive some problems when reading pdf files. What can I do???

    Reader 5 is not Windows Compatible. Two different versions of the same computer can cause all sorts of problems. Remove all Acrobat and/or Reader software then re-install Reader X.

  • Ipod too slow when reading video files via DVD player with USB port.

    Hi all, this is my first message in this forum.
    I've got a DVD player that has a USB port and reads all types of disks. When I use my IPOD 80 GB the files I read are somehow frozen and don't run properly (lack of sync between audio and video, etc). I've got version 1.2.1 and use it in disk mode otherwise the player doesn’t see it. Meanwhile a friend of mine uses it's 60 Gb IPO on the same player, version 1.0 and it doesn't need to go to disk mode, and the player reads perfect from it. Is this a problem of the ipod software version?
    Both ipods are in Fat32 format, but in his ipod the partition is set to active. I can't change mine to that, because windows is seeing my IPOD as a removable device, and my friend’s IPOD as a disk.
    Hope I haven't been too confusing, and I welcome any help anyone can give.
    Thanks.

    Sorry, but I don't even know
    what it is you are trying to do. Are you attaching
    the iPod to a stand alone DVD player? Are you trying
    to export stuff out of the iPod into the DVD player?
    Patrick
    Hi, I'm attaching the iPod to a stand alone DVD player, that has a usb input port. And then read video files from it.

  • I'm trying to Ignore a file header when reading a file, but no succes?? Take a look.... please...

    I posted the question in another forum,
    Take a look at my VI,
    What is wrong
    I'm trying to ignore the Header sekvens, (the first line) when reading the data to a chart.
    but ts noyt working,, did i missed something!?
    Zamzam
    HFZ
    Attachments:
    ReadDataFile11.vi ‏87 KB

    Hi again HFZ,
    The "read file" function has an option called "line mode" which is False by default, if you link a TRUE instead, you will only read one line of your file, you can then play with the offset in a while loop to read lines until the end of the file.
    But it might be even easier to read the whole file (with line mode False) then do a "spreadsheet string to array" (look in arra palette) and then remove the first line.
    I'm sorry I don't have time to have a look/modify your VI... On top of that you'll get much more satisfaction if you get through that yourself
    have fun !
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • Problem with nextDouble when reading txt files

    Hello, im very new to java and im trying to read a double number from a text file but I get an error if i dont write int values, for example:
    my txt file:
    John Smith
    32.5part of my Java code:
    out.println(myScanner.nextLine());
    out.println(myScanner.nextDouble());(myScanner read my text file)
    but I get this error:
    Exception in thread "main" java.util.InputMismatchException
    at java.util.Scanner.throwFor(Scanner.java:840)
    at java.util.Scanner.next(Scanner.java:1461)
    at java.util.Scanner.nextDouble(Scanner.java:2387)
    at TeamFrame.<init>(TeamFrame.java:15)
    at Baseball.main(Baseball.java:14)
    Im following the Java for dummies book and according to the book this should work.

    (Please post using the {code} tags - you put {code} at the start of your code and again at the end so that it's readable when it appears here. If nobody has replied to your post you can edit it and put the tags in now.)
    The code you posted doesn't correspond to the data you posted originally.
    Also when you say "nextLine()" the scanner reads and return s a line and it moves to the next line. But when you say "nextInt()" or "nextDouble()" it doesn't move to the next line even when there's nothing but an int or a double on the line it's reading. That's because there is a newline character and the scanner stops just before that.
    The solution is to say nextLine() straight after every nextInt() or nextDouble(). The nextLine() - whose result you just throw away - will move you to the next line.
    You do this in the case of the int you read, but not in the case of the doubles.
    Edited by: pbrockway2 on Jan 3, 2008 12:35 PM
    Posted with regard to:import java.util.Scanner;
    import java.io.File;
    import java.io.IOException;
    public class Baseball {
    public static void main(String[] args) throws IOException {
        Scanner myScanner = new Scanner(new File("C:\\Users\\Dennis\\Documents\\
            JCreator LE\\MyProjects\\first\\Baseball\\src\\
            Hankees.txt"));
        int nrPlayers = myScanner.nextInt();
        myScanner.nextLine();
        for (int num = 1; num <= nrPlayers; num++) {
            String name = myScanner.nextLine();
            double average = myScanner.nextDouble();
    }

  • How should i set the baseURI when a db file path with a space

    if the db file in a path like c:\program file\myapplication,then i set the baseURI dbxml:c:\program file\myapplication ,some exception occur~what should i do ?
    thanks a lot

    The Base URI needs to be a valid URI, which means it cannot include the Windows '\' character at all. In your case, you should be fine using something along the lines of "file:////C:/program file/myapplication"
    (give or take a '/' or two -- I haven't tested this).
    It's a common for BDB XML users to confuse the argument to create/openContainer() (a filesystem path) with the Base URI (a URI). The meanings and requirements are different. The best thing to do is to set and use a container alias (XmlContainer::addAlias()) to use in your queries.
    Regards,
    George

  • Problem rendering certain bytes when reading binary file

    I have a two part problem. I am trying to read files of any type from a client and transfer them over a pipe to a UNIX host running a C API. I have this process working for text data just fine however when I try and submit binary data there appears to be some data loss. Most of the file appears to end up on the host but it just isn't as long as the source, nor will it render correctly.
    In investigating this problem I tried to simply output a temporary copy of the transferred file on the client as I was reading the file just to see if my "thinking/process" was correct. The copy of the file ends up the same length but some bytes seem to have been misread. Upon doing a windiff on the source and copy it appears that several characters that are rendered as blocks in the original show up as '?' in the destination file.
    I believe this is an entirely different problem than why I am losing data on the host side but I want to first figure out why this problem is occuring. The below code is how I am reading and writing the binary file. I realize it has some problems with it, it is more of a POC at this point.
               final int BUF_SIZE = 1000;  // 1K
               char[] cBuffer = new char[BUF_SIZE];
               byte[] bBuffer = new byte[BUF_SIZE];
               int read = BUF_SIZE;
               long length = fLocalFile.length();
               FileInputStream fis = new FileInputStream(fLocalFile);
               DataInputStream dis = new DataInputStream(fis);
               FileOutputStream fos = new FileOutputStream("C:\\temp.file", false);
               DataOutputStream dos = new DataOutputStream(fos);
               for (int start = 0; start < length && reply.getSuccess(); start += read)
                   System.out.println("length: " + length + " start: " + start);
                   read = dis.read(bBuffer, 0, BUF_SIZE);
                   // Send the file data
                   String sTemp = sDestName + ":" + new String(bBuffer,0,read);
                   dos.write(bBuffer,0,read);
                   reply = axBridge.execute (Commands.CMD_FILE_TRANSFER_SEND, sTemp);
                dos.close();
            }It seems as if when reading or writing on the data streams some of the characters aren't getting converted correctly. Can anyone help? I've been testing with a PDF if that sheds any light.

    Yes but you ARE converting to a String first which you then send to the axBridge (sTemp!). Try just sending the bytes. You can easily pre-pend the "<filename>:" by sending those first.
    I know that some conversions occur when converting to a String, what they are exactly and what the exact effects are escapes me. Past experience though has taught me to ALWAYS send bytes, with no conversions, what you read is what you send.
    You may need to modify the send/receive protocol so that you send the command first with the filename then the bytes are sent after...
    As for why the file is not being written correctly to: c:\\temp.file, don't know... try the following code, it tends to be one of the "standard" ways of "streaming" data...
         byte buf[] = new byte[bufSize];
         int bRead = -1;
         while ((bRead = in.read (buf)) != -1)
             out.write (buf,
                     0,
                     bRead);
         }     And try just using a FileOutputStream or wrapping in a BufferedOutputStream.

  • Issues with file locking when reading a file using RollingFile Appender

    Hi,
    I am facing a file Rotation Issue with log4j. I want a way to read one file from two diff apps.
    Intro: App A is writing a file F using log4j rolling file appender and app B is reading the same file F using “new BufferedReader(new InputStreamReader(new FileInputStream(_file)))”.
    Issue: App A is not able to roll the file. Because it is having a handle on the same file F.
    Please let me know how can I handle this issue.

    If you have the file open for reading when log4j tries to rename it, the rename will fail. Solution: don't have the file open for reading.
    I want to read the feed of such rolling logs without closing any handle.I gave you a solution to that too.
    If I am closing the handle after every read then there will be no way to determine where I left.Nobody suggested that.
    Is there any possible solution for this?What part of the solution I have already posted didn't you understand?

  • Pls, Determine what file's encoding when read a file use NIO

    Hi every body,
    When I use NIO (New I/O JDK1.4) to read a file's content.
    How can I know exactly file's encoding (example: UTF-8, Cp1252, shift-jis ...) to choose right decoder to decode the file??
    Thanks
    Best regards.
    Hung, Nguyen Thanh.

    I think there's no way to do that except...
    If you are sure your files are all in japanese,
    you can use JISAutoDetect encoding.

  • Is there to set one link's color in JEditorPane, when reading HTMl files?

    I jsut want to set ONLY ONE link a certain color. How do I do that?
    Thanks.
    Virum

    If you are just getting the JEditorPane to read in a HTML file then you would have to specify the HTML on the link you want, i.e. set the attributes on the "a" tag or use a style sheet.
    Or course you could dive into the HTMLDocument used by the HTMLEditorKit and set the attributes for the specific "a" tag but then you would have to try and find it in there...good luck!
    Or of course you could modify the HTML file prior to loading it into the editor...

  • HT5557 How to set Night mode on Ipad Mini iBooks apps when reading PDF file?

    How to set Night mode in iBooks (ver 3.1) for iPad Mini?

    It's not available within the iBooks app  for PDFs, the closest you can get is to the Invert Colours accessibility option  (though pictures will appear negative) -  you can set Settings > General > Accessbility > Triple-Click Home to 'Invert Colours', which means that you can then use a triple-click of the home button to go to white text on a black background.

  • PS3 droplet called from command line in XP reads in files but does not execute action

    Hello.
    I am a researcher interested in anxiety disorders in young children. As part of a functional magnetic resonace brain imaging study we need to compare children's responses to familiar and unfamiliar faces. The latter are no problem, but for the former we need to take pictures of the children's mothers and process them "on the fly" so that they can be incorporated into stimulus sets presented in the MRI machine (otherwise known as the "magnet").
    For presentation in the magnet, the images have to be in a particular format. I have created an action that produces the appropriate format, and a PS3 droplet that behaves appropriately (outputs correctly modified files to the stated address) when a Windows XP (SP3) folder is dropped on it.
    However, I need to automate the procedure further because it will be executed by individuals with little or no understanding of PS etc.
    It occurred to me that I could call my droplet from the XP command line with the folder containing the relevant files as an argument (and then I would be able to incorporate this function into an overall control program).
    However, I have found that this approach loads the relevant files into CS3, but that the actions don't run.
    I would very much appreciate any help with this problem.
    Thank you.
    Adrian Angold.

    A command line script might work, but would lack a user interface. Error
    processing and logging capabilities would also be limited.
    I would consider writing a small application in a language such as Visual
    Basic or C# that uses Photoshop's automation interface. The automation SDK
    is provided on the Photoshop DvD.

  • "Bad data format" when reading txt file from the presentation server

    Hello,
    I have a piece of code which reads a txt file from the presentation server to an internal table like below:
    DATA : lv_filename type string.
    lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
    CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME              = lv_filename
    CHANGING
       DATA_TAB            = lt_tsd. " lt_tab has the exact same fields as the Test.txt's. Test.txt has only one line, tab delimited.
    When running this code, exception BAD_DATA_FORMAT is issued.
    Is it because of the file encoding or delimiter or other reason?
    Thanks,
    Yang

    Hello,
    If its tab delimited then use the has_field_seperator parameter and check
    DATA : lv_filename type string.
    lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
    CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME                = lv_filename
       FILETYPE                 = 'ASC'
       HAS_FIELD_SEPARATOR          = u2018Xu2019
    CHANGING
       DATA_TAB            = lt_tsd.
    Vikranth

  • ACR 5.2 too blue when reading CR2 files

    I shot raw files at a fashion shoot with a white balance of 2900. In camera they look fine. In Canon's DPP software they are also good. When loaded into Adobe Brigde they are too blue. Is there a setting I have missed in Bridge, or would a white balance in DPP of 2900 be naturally warmer than in ACR 5.2? Thanks for your advice. John

    >In fact, to arrive at Canon's white balance kelvin reading of 2900, I have to move the ACR slider to read somewhere around 3900-4200 depending. CS2 didn't have this problem when I did similar shoots under the same lighting conditions. Any thoughts?
    The white balance is profile dependent. ACR translates the camera reading to its own system in order to keep the neutrals neutral. You should not put too much weight in the numbers being different they are supposed to. If you set the profile to camera standard and leave the white balance as shot you will get identical rendering as in DPP using default in-camera settings.

Maybe you are looking for

  • My ipod touch 4th gen won't update

    Hi. My ipod touch won't update, it always says estimating time remaining then "Error occured" it happened many times already. even with strong internet connection please help me. thank you!

  • Help me activate my imessage please

    How do you register contacts in imessage

  • Is this 2014 or 1960?

    I just want to say that it is completely ridiculous for a company that claims to be cutting edge to have such shoddy service when it comes to certification.  Ordering an exam voucher should not be that difficult.  I ordered one and after waiting two

  • TX and RX Descriptors

    Hello, I tried searching on a lot of sites but need a conclusive answer. I am having problems with a highly-loaded servers, and concluded that the connection hangs ALWAYS for the first 80 packets then continues as normal ( eg. ping hangs for first 80

  • Can't find library libjsafe.so in LIBPATH (Weblogic 5.1 on AIX 4.3.3)