Problem in reading this particular text file, what is the problem with it..

Hai to all..,
I had developed an application to read the text file that is stored in my computer from mobile, all are working fine but some files create problems in reading the file content, like the file i had attached with this..
Can any one please tell why this particular file creates problem in reading the contents...
I had attached a text file with this...
and the code I am using is
int getcharcount;
FileInputStream fstream = new FileInputStream(filename);
InputStreamReader in = new InputStreamReader(fstream);
while ((getcharcount = in.read()) != 0)
     getchar = getchar + (char) getcharcount;
System.out.println("Full File Content :"+getchar);
I try'd with BufferedReader also, but have the same problem,
Can any one please give me a solution for this..

Hai to all..,
Sorry for the previous posting,
I had developed an application to read the text file that is stored in my computer from mobile, all are working fine but some files create problems in reading the file content, like the file i had attached with this..
Can any one please tell why this particular file creates problem in reading the contents...
and the code I am using is
int getcharcount;
FileInputStream fstream = new FileInputStream(filename);
InputStreamReader in = new InputStreamReader(fstream);
while ((getcharcount = in.read()) != 0)
     getchar = getchar + (char) getcharcount;
System.out.println("Full File Content :"+getchar);
I try'd with BufferedReader also, but have the same problem,
Can any one please give me a solution for this..The error I am getting is
Full File Content :ÿþC
But the file contains plain text only..
Edited by: Kamal Raj on Oct 17, 2010 10:22 PM

Similar Messages

  • Reading from a text file and displaying the contents with in a frame

    Hi All,
    I am trying to read some data from a text file and display it on a AWT Frame. The contents of the text file are as follows:
    pcode1,pname1,price1,sname1,
    pcode2,pname2,price2,sname1,
    I am writing a method to read the contents from a text file and store them into a string by using FileInputStream and InputStreamReader.
    Now I am dividing the string(which has the contents of the text file) into tokens using the StringTokenizer class. The method is as show below
    void ReadTextFile()
                        FileInputStream fis=new FileInputStream(new File("nieman.txt"));
                         InputStreamReader isr=new InputStreamReader(fis);
                         char[] buf=new char[1024];
                         isr.read(buf,0,1024);
                         fstr=new String(buf);
                         String Tokenizer st=new StringTokenizer(fstr,",");
                         while(st.hasMoreTokens())
                                          pcode1=st.nextToken();
                               pname1=st.nextToken();
              price1=st.nextToken();
                              sname1=st.nextToken();
         } //close of while loop
                    } //close of methodHere goes my problem: I am unable to display the values of pcode1,pname1,price1,sname1 when I am trying to access them from outside the ReadTextFile method as they are storing "null" values . I want to create a persistent string variable so that I can access the contents of the string variable from anywhere with in the java file. Please provide your comments for this problem as early as possible.
    Thanks in advance.

    If pcode1,pname1,price1,sname1 are global variables, which I assume they are, then simply put the word static in front of them. That way, any class in your file can access those values by simply using this notation:
    MyClassName.pcode1;
    MyClassName.pname1;
    MyClassName.price1;
    MyClassName.sname1

  • When creating installer files, there is an error:the system cannot find the customResource2052.dll file, what's the problem?

    I am using labview2009, when I create a installer, there is an error report as blow:
     Error: Windows SDK function returned an error. (Error code -12)
    Error accessing a resource module "E:\工作资料\项目资料\绿盾\builds\Untitled Project 1\...\Volume\supportfiles\customResource2052.dll".
    The system cannot find the file specified.
    *** Error Details:
    Error in MDF API function: _MDFBuildDist_Build
    Error in MetaToolbox::UpdateResourceString.
             strId: 3; New String:     ; LangId: 2052
    Windows function LoadLibraryEx returned an error. Error code: 2
    *** End Error Report

    Hi super008,
    The error can be due to some improper installation of a driver or any NI SW that the Installer requires.
    Have you recently installed or Uninstalled any NI Software ?
    Also -
    You can see in the KB below -
    That it could also happen due to some incompatibility with the .NET framework or adding exception in the AntiVirus.
    SDK Error Code -12 When Building a LabVIEW Installer or Installing LabVIEW
    http://digital.ni.com/public.nsf/allkb/AFC375154EFBD6AE8625760B005FB723?OpenDocument
    One more question :
    Do you have any idea what is this resource :
    E:\工作资料\项目资料\绿盾\builds\Untitled Project 1\...\Volume\supportfiles\customResource2052.dll    ????
    is "Untitled Project 1" your project ?

  • TS1382 my ipod will not play any format of film i have tried mp4 and .mov and it says this format not supported what is the problem

    i have an ipod classic and i have tried to put films on but every format i try it keeps saying thei format not supported i have tried mp4 and .mov and it will not take it anyone got any suggestions on what format to use and the best way to convert films

    If these problem videos are already stored in your iTunes library, try using the iTunes built in convert to convert the file to an even friendlier iPod format.  To use it, highlight the video in iTunes and choose Advanced -> Create iPod or iPhone version from the drop down menu.  When the conversion process has completed, try syncing the new version over to your iPod Classic.
    B-rock

  • Getting repeated values when reading from a text file.

    I need to read from a text file. When the token encounters a particular word (command) I need to read the next line and perform some actions. However, this part is working but it is repeating the values again and again until it encounters the next particular word (command). Hope that someone will help me out, as always when I posted a problem in these forums.
    SetOperations class - contains the set methods
    // Imported packages.========================================================
    import java.util.Vector;
    import java.util.Iterator;
    // Public class SetOperations.===============================================
    public class SetOperations
         // Instance variables.===================================================
         private Vector v = null; // Creates new instance of vector.
         protected int memberCount;
         // Constructor.==========================================================
         public SetOperations()
              v = new Vector();
         } // end constructor.
         // Method isMember.======================================================
         * Checks whether the element is already a member of the set.
         * @return True if Vector v contains Object member.
         public boolean isMember(Object member)
              if (member != null) // only if Object member is not null.
                   return v.contains(member); // returns true if vector already contains member.
              else
                   return false; // returns false if vector does not contain member.
         } // end public boolean isMember(Object member).
         // Method addMember.=====================================================
         * Adds a member to the set.
         * @return Adds Object member to Vector v.
         public void addMember(Object member)
              //if (! v.contains(member)) // only if element is not already a member.
              if (isMember(member) == false) // only if element is not already a member.
                   v.add(member); // adds a member.
         } // end public void addMember(Object member).
         // Method countMember.===================================================
         * Returns the number of members present in the vector.
         * @return Number of elements present in the vector.
         public int countMember()
              return v.size();
         } // end public int countMember().
         // Method isSetEmpty.====================================================
         * Returns true if set is empty.
         * @return True if no elements are present in Vector v.
         public boolean isSetEmpty()
              return v.size() == 0; // returns 0 if no elements are present in the vector.
         } // end of public boolean isSetEmpty().
         // Method printMember.===================================================
         * Displays member/s of the set.
         * @return Prints element/s present in the vector.
         public void printMember()
              for (int i = 0; i < v.size(); i++) // iterates through present members.
                   System.out.println("[" + i + "] " + v.get(i)); // displays member/s present in the vector.
         } // end of public void printMember().
    } // end public class SetOperations.
    SetTextLauncher class - reads from a text file and implements the set operations
    // Imported packages.========================================================
    import java.util.*;
    import java.io.*;
    // Public class SetTestLauncher.=============================================
    public class SetTestLauncher
         // Main method public static void main(String args[]).===================
         public static void main(String args[])
              displayFile("test.txt"); // outputs result from text file.
         // method to display a file on screen
         public static void displayFile (String textFile)
              // Instance variables.===============================================
              // Creates new instances of SetOperations.
              SetOperations setA = new SetOperations();
              SetOperations setB = new SetOperations();
              SetOperations setC = new SetOperations();
              SetOperations setD = new SetOperations();
              SetOperations setE = new SetOperations();
              // Initialisation.
              String line = "", nextLine = "";
              FileReader fr = null;
              try
                   // Opens the file with the FileReader data sink stream.
                   fr = new FileReader(textFile);
                   // Converts the FileReader input stream with the BufferedReader processing stream.
                   BufferedReader br = new BufferedReader(fr);
                   // Iterates through text file reading lines until end of text lines.
                   while (line != null)
                        line = br.readLine(); // reads one line at a time.
                        if(line == null) break; // when the line is null break the loop.
                        // Creates a new instace of StringTokenizer.
                        StringTokenizer st = new StringTokenizer(line);
                        // Loops until there are no more tokens.
                        while (st.hasMoreTokens())
                             String token = st.nextToken(); // reads next token.
                             // Only if the token encounters the String "membera".
                             if(token.equals("membera"))
                                  nextLine = br.readLine(); // gets next line.
                                  setA.addMember(nextLine); // adds a member to the set.
                                  // Displays members present in the set if vector is not empty.
                                  if (! setA.isSetEmpty())
                                       setA.printMember(); // print members present.
                                  // Displays the number of member/s present in the vector.
                                  System.out.println("Number of set members: " + setA.countMember());
              // Catches and displays exceptions.
              catch (FileNotFoundException exp)
                   System.out.println(exp.getMessage());
                   exp.printStackTrace();
              catch (IOException exp)
                   System.out.println(exp.getMessage());
                   exp.printStackTrace();
              finally
                   try
                        // if file is found
                        if (fr != null)
                             // close file
                             fr.close();
                   catch (IOException exp)
                        exp.printStackTrace();
         } // end public static void main(String args[]).
    } // end public class SetTestLauncher.

    Thanks for your interest. Please ignore SetOperations class, it is just the class containing the methods and it works correctly since I checked it without reading from a text file. I marked the part where I think lies my problem in class SetTestOperations.
    The information in the text file is as follows:
    membera
    Hillman
    membera
    Skoda
    membera
    Honda
    membera
    Toyota
    and the result is:
    [0] Hillman
    Number of set members: 1
    [0] Hillman
    [1] Skoda
    Number of set members: 2
    [0] Hillman
    [1] Skoda
    [2] Honda
    Number of set members: 3
    [0] Hillman
    [1] Skoda
    [2] Honda
    [3] Toyota
    Number of set members: 4
    instead of just one set:
    [0] Hillman
    [1] Skoda
    [2] Honda
    [3] Toyota
    Number of set members: 4
    Hope it is easier to understand like this.
    Regards
    Marco
    I need to read from a text file. When the token
    encounters a particular word (command) I need to read
    the next line and perform some actions. However, this
    part is working but it is repeating the values again
    and again until it encounters the next particular
    word (command). Hope that someone will help me out,
    as always when I posted a problem in these forums.
    SetOperations class - contains the set
    methods
    // Imported
    packages.=============================================
    ===========
    import java.util.Vector;
    import java.util.Iterator;
    // Public class
    SetOperations.========================================
    =======
    public class SetOperations
    // Instance
    e
    variables.============================================
    =======
    private Vector v = null; // Creates new instance of
    f vector.
         protected int memberCount;
    Constructor.==========================================
    ================
         public SetOperations()
              v = new Vector();
         } // end constructor.
    // Method
    d
    isMember.=============================================
    =========
    * Checks whether the element is already a member of
    f the set.
         * @return True if Vector v contains Object member.
         public boolean isMember(Object member)
    if (member != null) // only if Object member is not
    ot null.
    return v.contains(member); // returns true if
    if vector already contains member.
              else
    return false; // returns false if vector does not
    not contain member.
         } // end public boolean isMember(Object member).
    // Method
    d
    addMember.============================================
    =========
         * Adds a member to the set.
         * @return Adds Object member to Vector v.
         public void addMember(Object member)
    //if (! v.contains(member)) // only if element is
    is not already a member.
    if (isMember(member) == false) // only if element
    nt is not already a member.
                   v.add(member); // adds a member.
         } // end public void addMember(Object member).
    // Method
    d
    countMember.==========================================
    =========
    * Returns the number of members present in the
    e vector.
         * @return Number of elements present in the vector.
         public int countMember()
              return v.size();
         } // end public int countMember().
    // Method
    d
    isSetEmpty.===========================================
    =========
         * Returns true if set is empty.
    * @return True if no elements are present in Vector
    r v.
         public boolean isSetEmpty()
    return v.size() == 0; // returns 0 if no elements
    ts are present in the vector.
         } // end of public boolean isSetEmpty().
    // Method
    d
    printMember.==========================================
    =========
         * Displays member/s of the set.
         * @return Prints element/s present in the vector.
         public void printMember()
    for (int i = 0; i < v.size(); i++) // iterates
    es through present members.
    System.out.println("[" + i + "] " + v.get(i)); //
    // displays member/s present in the vector.
         } // end of public void printMember().
    } // end public class SetOperations.
    SetTextLauncher class - reads from a text file
    and implements the set operations
    // Imported
    packages.=============================================
    ===========
    import java.util.*;
    import java.io.*;
    // Public class
    SetTestLauncher.======================================
    =======
    public class SetTestLauncher
    // Main method public static void main(String
    g args[]).===================
         public static void main(String args[])
    displayFile("test.txt"); // outputs result from
    om text file.
         // method to display a file on screen
         public static void displayFile (String textFile)
    // Instance
    ce
    variables.============================================
    ===
              // Creates new instances of SetOperations.
              SetOperations setA = new SetOperations();
              // Initialisation.
              String line = "", nextLine = "";
              FileReader fr = null;
              try
    // Opens the file with the FileReader data sink
    ink stream.
                   fr = new FileReader(textFile);
    // Converts the FileReader input stream with the
    the BufferedReader processing stream.
                   BufferedReader br = new BufferedReader(fr);
    // Iterates through text file reading lines until
    til end of text lines.
                   while (line != null)
    line = br.readLine(); // reads one line at a
    at a time.
    if(line == null) break; // when the line is null
    null break the loop.
                        // Creates a new instace of StringTokenizer.
                        StringTokenizer st = new StringTokenizer(line);
                        // Loops until there are no more tokens.
                        while (st.hasMoreTokens())
    String token = st.nextToken(); // reads next
    next token.
    // Only if the token encounters the String
    tring "membera".
                             if(token.equals("membera"))
                                  // *****THE PROBLEM LIES HERE....I GUESS
    // need to read the next line after encountering the word membera in text file
    nextLine = br.readLine(); // gets next line.
    setA.addMember(nextLine); // adds a member to
    ber to the set.
    // Displays members present in the set if
    set if vector is not empty.
                                  if (! setA.isSetEmpty())
                                       setA.printMember(); // print members present.
    // Displays the number of member/s present in
    ent in the vector.
    System.out.println("Number of set members: " +
    s: " + setA.countMember());
              // Catches and displays exceptions.
              catch (FileNotFoundException exp)
                   System.out.println(exp.getMessage());
                   exp.printStackTrace();
              catch (IOException exp)
                   System.out.println(exp.getMessage());
                   exp.printStackTrace();
              finally
                   try
                        // if file is found
                        if (fr != null)
                             // close file
                             fr.close();
                   catch (IOException exp)
                        exp.printStackTrace();
         } // end public static void main(String args[]).
    } // end public class SetTestLauncher.

  • Reading Tab Delimited Text File

    HI
    I am having problem in reading Tab Delimited text file.
    If i place some spaces in name of text file. it dosn`t read the file.
    if there is a simple name without space, then it reads easily.
    but when having space in file name then it shows nothing.
    PLZ help me .......
    give me some code or links to solution
    thanks!

    Could you post up an example of the file? With a FedEx report file, I created an application to read each line and split the String into an array where ever a [tab] exists. Since the columns aren't evenly tabbed, I used a regular expression to replace any whitespace in a with a \t (tab). Now it takes that line and splits it into an array where the [tab] exists. Then I access that specific column in the String by line.
    08/28/2007                        FedEx Ground                             COLO2
    23:16:29                        LANE FULL REPORT                  reptClaneFulls
                                                                              Page 1
                          Next               Sorters
                          Load         Main            Auto Smalls
                 Chute    Point  Primary  Secondary  Primary  Secondary
                 0101     8001         0         11        0          0
                 0102     5333         0          9        0          0
                 0104     0142         0        441        0          0
                 0106     0328         0          5        0          0
                 0107     0452         0          2        0          0
                 0110     0333         0          2        0          0
                 0113     0447         0          7        0          0
                 0114     0447         0          1        0          0
                 0115     0303         0         11        0          0
                 0127     0132         0          2        0          0
                 0128     0132         0         11        0          0
                 0129     0132         0          9        0          0
                 0130     0405         0        102        0          0
                 0131     0371         0        270        0          0
                 0132     0371         0        168        0          0
                 0133     0122         0         13        0          0
                 0134     0456         0         36        0          0
                 0135     0146         0        152        0          0
                 0136     0146         0          2        0          0
                 0138     0371         0         24        0          0
                 0201     0552         0          9        0          0
                 0204     0445         0         69        0          0
                 0205     0445         0         51        0          0
                 0207     0641         0          1        0          0
                 0211     0551         0          1        0          0
                 0212     0454         0          7        0          0
                 0213     3441         0         39        0          0
                 0216     0841         0          1        0          0
                 0217     0631         0        211        0          0
                 0222     0441         0         12        0          0
                 0223                  0          5        0          0
                 0224     0441         0          9        0          0
                 0225     0441         0         42        0          0
                 0226     0441         0         11        0          0
                 0227     0441         0          5        0          0
                 0229     0619         0        753        0          0
                 0230     0619         0        188        0          0
                 0231     0602         0          2        0          0
                 0232     0604         0         91        0          0
                 0233     0604         0          3        0          0
                 0238     0601         0          1        0          0
                 0304     1435         0         12        0          0
                 0307     2430         0        477        0          0
                 0309     1430         0         98        0          0
                 0310     1430         0          1        0          0
                 0311     0971         0          1        0          0
                 0312     0449         0         19        0          0
                 0313     0449         0        128        0          0
                 0315     0923         0         31        0          0
                 0316     0981         0         11        0          0
                 0317     0972         0          9        0          0
    08/28/2007                        FedEx Ground                             COLO2
    23:16:29                        LANE FULL REPORT                  reptClaneFulls
                                                                              Page 2
                          Next               Sorters
                          Load         Main            Auto Smalls
                 Chute    Point  Primary  Secondary  Primary  Secondary
                 0318     0972         0          6        0          0
                 0319     2431         0          1        0          0
                 0323     0436         0          9        0          0
                 0324                  0          3        0          0
                 0326     3431         0         12        0          0
                 0328     0958         0         55        0          0
                 0332     0430         0         84        0          0
                 0333     0430         0         16        0          0
                 0334     4430         0         29        0          0
                 0337     0480         0          2        0          0
                 0343     0555         0         36        0          0
                 0405     1437         0         52        0          0
                 0406     1437         0         51        0          0
                 0407     3152         0         58        0          0
                 0408     3152         0          2        0          0
                 0410     0152         0          5        0          0
                 0411     0152         0          3        0          0
                 0415     0100         0         55        0          0
                 0417     0253         0         95        0          0
                 0420     0282         0          1        0          0
                 0421     0282         0         82        0          0
                 0422     0753         0         13        0          0
                 0425     0165         0          9        0          0
                 0426     0165         0          8        0          0
                 0427     0089         0         21        0          0
                 0428     0089         0         10        0          0
                 0434     0437         0          3        0          0
                 0436     0170         0          4        0          0
                 0441     0263         0          9        0          0
                 0442     0219         0          1        0          0
                 0443     0219         0         20        0          0
                 0444     3258         0          3        0          0
                 0447     0156         0         89        0          0
                 0448     0156         0         59        0          0
                 0449     0156         0          1        0          0
                 0450     0760         0         14        0          0
                 0451     3163         0         16        0          0
                 0453     0212         0         27        0          0
                 0454     7760         0          2        0          0
                 107A     0219         0          0        0         88
                 108A     0219         0          0        0         89
                 110A     7061         0          0        0        185
                 111A     7061         0          0        0        190
                 112A     0170         0          0        0          3
                 113A     0170         0          0        0          1
                 114A     0170         0          0        0          3
                 118A     0089         0          0        0        261
                 119A     0089         0          0        0        255
                 120A     0282         0          0        0          5
                 121A     0282         0          0        0          4
                 122A     0753         0          0        0          6
    08/28/2007                        FedEx Ground                             COLO2
    23:16:29                        LANE FULL REPORT                  reptClaneFulls
                                                                              Page 3
                          Next               Sorters
                          Load         Main            Auto Smalls
                 Chute    Point  Primary  Secondary  Primary  Secondary
                 124A     3156         0          0        0        258
                 125A     0258         0          0        0         74
                 126A     3258         0          0        0          3
                 127A     0263         0          0        0         34
                 128A     3263         0          0        0          7
                 129A     0152         0          0        0         39
                 130A     0152         0          0        0         44
                 131A     0152         0          0        0         33
                 132A     3152         0          0        0        176
                 133A     3152         0          0        0        181
                 134A     0253         0          0        0         34
                 135A     0253         0          0        0         34
                 136A     3253         0          0        0        103
                 137A     0156         0          0        0         85
                 138A     0156         0          0        0         87
                 139A     0437         0          0        0        271
                 140A     3437         0          0        0        111
                 141A     0165         0          0        0        204
                 142A     3165         0          0        0          5
                 143A     0163         0          0        0          9
                 144A     3163         0          0        0          5
                 147A     7760         0          0        0          9
                 201A     8001         0          0        0          1
                 202A     8001         0          0        0          2
                 205A     3435         0          0        0         62
                 206A     0402         0          0        0        218
                 208A     0405         0          0        0         15
                 212A     0411         0          0        0          5
                 213A     0411         0          0        0          5
                 214A     3441         0          0        0        224
                 215A     3441         0          0        0        225
                 216A     0410         0          0        0          9
                 217A     0449         0          0        0         49
                 218A     0449         0          0        0         51
                 219A     3452         0          0        0         12
                 220A     0452         0          0        0          4
                 221A     0452         0          0        0          6
                 222A     3431         0          0        0         33
                 223A     3431         0          0        0         38
                 224A     2430         0          0        0         14
                 225A     2430         0          0        0         14
                 226A     4430         0          0        0         15
                 227A     4430         0          0        0         15
                 228A     0430         0          0        0          4
                 229A     0430         0          0        0          4
                 230A     1430         0          0        0         11
                 231A     1430         0          0        0         23
                 232A     0456         0          0        0         96
                 233A     7433         0          0        0          9
                 234A     0333         0          0        0          3
                 235A     7641         0          0        0         10
    08/28/2007                        FedEx Ground                             COLO2
    23:16:29                        LANE FULL REPORT                  reptClaneFulls
                                                                              Page 4
                          Next               Sorters
                          Load         Main            Auto Smalls
                 Chute    Point  Primary  Secondary  Primary  Secondary
                 236A     0802         0          0        0          5
                 240A     0631         0          0        0        111
                 241A     0551         0          0        0          3
                 245A     0958         0          0        0         71
                 246A     0554         0          0        0         72
                 247A     0923         0          0        0         48
                 248A     0371         0          0        0         31
                 249A     0972         0          0        0         49
                 250A     0381         0          0        0          3
                 251A     0619         0          0        0         27
                 253A     0604         0          0        0         48
                 254A     0132         0          0        0         57
                 255A     0132         0          0        0         53
                 257A     0942         0          0        0         16
                 307A     0951         0          0        0        138
                 308A     0464         0          0        0         22
                 309A     0641         0          0        0         45
                 310A     0641         0          0        0         47
                 311A     0122         0          0        0         16
                 312A     0971         0          0        0         76
                 313A     0602         0          0        0         37
                 314A     0841         0          0        0          9
                 315A     0841         0          0        0          8
                 317A     0958         0          0        0          2
                 318A     0532         0          0        0         35
                 320A     0604         0          0        0         16
                 322A     0981         0          0        0         90
                 323A     0371         0          0        0         42
                 324A     0972         0          0        0         13
                 325A     0372         0          0        0         35
                 326A     0928         0          0        0         14
                 327A     0619         0          0        0         78
                 328A     0328         0          0        0         17
                 330A     0303         0          0        0         27
                 331A     0923         0          0        0          1
                 332A     0336         0          0        0          3
                 333A     7850         0          0        0          7
                 335A     0146         0          0        0          8
                 337A     0454         0          0        0         20
                 338A     3445         0          0        0         86
                 339A     0445         0          0        0        371
                 340A     1441         0          0        0         42
                 341A     2442         0          0        0        111
                 342A     0441         0          0        0         59
                 343A     1442         0          0        0         23
                 344A     0442         0          0        0         28
                 345A     7441         0          0        0         66
                 346A     4441         0          0        0         73
                 347A     2441         0          0        0         72
                 348A     3462         0          0        0         12
                 349A     0462         0          0        0         62
    08/28/2007                        FedEx Ground                             COLO2
    23:16:29                        LANE FULL REPORT                  reptClaneFulls
                                                                              Page 5
                          Next               Sorters
                          Load         Main            Auto Smalls
                 Chute    Point  Primary  Secondary  Primary  Secondary
                 350A     0447         0          0        0         36
                 351A     0447         0          0        0         43
                 352A     3468         0          0        0          2
                 353A     0468         0          0        0         13
                 354A     0142         0          0        0         26
                 356A     0436         0          0        0          7
                 357A     0436         0          0        0          5
                 359A     0480         0          0        0         20
                 RLBL                  0         47        0          0
                 SSBL                  0        127        0          0
                 SSGN                  0         32        0          0
                 SSRD                  0        323        0          0
                 ======================================================
                 TOTAL:                0       5071        0       6630

  • Help needed regarding reading in a text file and tokenizing strings.

    Hello, I require help with a task I've been set, which asks me to read in a text file, and check the contents for errors. The text file contains lines as follows.
    surname:forename:1234:01-02-06
    I can read in the file, but dont know how to split the strings so each token can be tested (ie numbers in the name tokens)
    However, I am not allowed to use regex functions, only those found in java.io.*
    I think i should be putting the tokens into an array, but have had no luck so far in doing so. Any help would be appreciated.

    public class Validator {
         public static void main(String args[]) {
              String string = "Suname:Forename:1234:01_02-06";
              String stringArray[] = string.split(":");
              System.out.println (validateLetters(stringArray[0]));//returns true
              System.out.println (validateNumbers(stringArray[3]));//returns false
         static boolean validateLetters(String s) {
                 for(int i = 0; i < s.length(); i++) {
                 char c = s.charAt(i);
                 if ((c < 'A' || c > 'Z') && (c < 'a' || c > 'z')) {
                         return false; //return false if one of characters is other than a-z A-Z
                 }//end if
                 }//end for
                 return true;
         }//end validateLetters
         static boolean validateNumbers(String s) {
                 for(int i = 0; i < s.length(); i++) {
                 char c = s.charAt(i);
                 if ((c < '0' || c > '9') && (c != '-')) {
                         return false; //return false if one of characters is other than 0-9 or -
                 }//end if
                 }//end for
                 return true;
         }//end validateNumbers
    }

  • Set Adobe Acrobat XI Pro. When I want to save the file in WORD, EXCEL or esporta file into ... immediately throws an error "save as failed to process this document no file was created". What's the problem?

    Set Adobe Acrobat XI Pro. When I want to save the file in WORD, EXCEL or esporta file into ... immediately throws an error "save as failed to process this document no file was created".
    What's the problem?
    Any help in finding a solution is greatly appreciated.
    Thank you,

    Installed AcrobatXI PRO 11.0.09  on seven computers and laptops. Two of them gives an error when you try to save a document in WORD, EXCEL, Power Point, or when exporting to... error: Save failed to process this document. No File was created.
    But all good saves in the format of TXT and jpg.
    I have uninstalled and restored and re-installed and updated and registry cleaned and removed using the special utility Cleaner Tool for Acrobat, but nothing helps.
    On one notebook with Windows 8.1 and Microsoft office 2013, on another laptop with Windows 7 and Microsoft office 2010, the same problem, although there are computers with Windows 7 and Microsoft office 2010 and everything works.
    Tell me where to find the problem and how to solve it.
    Thank you.

  • A file want to save with this name "xstat_save" when i enter to some site .what is the problem?

    hi
    when i enter to some site like "http://www.mehrnews.com/en/" , a massage appear that a file with this name "xstat_save" want to save in hard disk.type of file is "aspx"
    what is the problem?
    plz help me
    thanks for your attention

    You usually see such a dialog to save a file if you have ad-blocking or security software that remove the GET data appended to a link to specify which file to load from the server.

  • I installed the InDesign CC Testversion and now i try to open INDD-Files from earlier Version. Always i get the error "This file is made by an earlier Version...." but it´s CC that is the latest Version. What is the problem ? Should i have to convert the

    I installed the InDesign CC Testversion and now i try to open INDD-Files from earlier Version. Always i get the error "This file is made by an earlier Version...." but it´s CC that is the latest Version. What is the problem ? Should i have to convert the files ?

    Adobe has been using confusing version names for at least five years.
    There are now two versions labeled CC, version 9 and version 10 (also known as CC 2014). Version 10 is the latest, and if you attempt to open a version 10 file in Version 9 that is not fully patched you will get an error message telling you that the file cannot be opened. The latest patch for version 9 should use a cloud-based service at Adobe to convert version 10 files to IDML and allow you to open that.
    I suspect you may be using an older operating system. Version 10 requires that your system runs at least OS X 10.7 or Windows 7 SP1 and if you are not it will not even be offered to you.

  • I would like to read a text file in which the decimal numbers are using dots instead of commas. Is there a way of converting this in labVIEW, or how can I get the program to enterpret the figures in the correct way?

    The program doest enterpret my figures from the text file in the correct way since the numbers contain dots instead of commas. Is there a way to fix this in labVIEW, or do I have to change the files before reading them in the program? Thanks beforehend!

    You must go in the labview option menu, you can select 'use the local
    separator' in the front side submenu (LV6i).
    If you use the "From Exponential/Fract/Eng" vi, you are able to select this
    opton (with a boolean) without changing the labview parameters.
    (sorry for my english)
    Lange Jerome
    FRANCE
    "Nina" a ecrit dans le message news:
    [email protected]..
    > I would like to read a text file in which the decimal numbers are
    > using dots instead of commas. Is there a way of converting this in
    > labVIEW, or how can I get the program to enterpret the figures in the
    > correct way?
    >
    > The program doest enterpret my figures from the text file in the
    > correct way since the numbers contain dots instea
    d of commas. Is there
    > a way to fix this in labVIEW, or do I have to change the files before
    > reading them in the program? Thanks beforehend!

  • Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Hi Memalyn
    Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
    My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
    If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
    Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
    Let us know what you find out, and if you manage to get your space back.
    Matt

  • Cannot install itunes 11.1.3 to my windows vista home premium 32-bit.  After it finishes the download that it verifies the file I get a message saying "this file cannot be downloaded". What could the problem be??? I uninstalled my itunes and tried again

    Cannot install itunes 11.1.3 to my windows vista home premium 32-bit.  After it finishes the download that it verifies the file I get a message saying "this file cannot be downloaded". What could the problem be??? I uninstalled my itunes and tried again and keep getting the same message.  Please help !

    See Troubleshooting issues with iTunes for Windows updates.
    For downloading issues see the further information area and use a different browser and/or the direct links.
    tt2

  • How can i read the text files and buffer the data in Vector?

    hi. I have been running into this problem for days, but with no luck and losing right direction.
    The problem is : I am trying to read a text file and buffer the data into a
    Queue for each user.
    the sample text file is as below:( 1st column is timestamp, 2nd is user_id, 3rd is packet_id, 4th is packet_seqno, 5th is packet_size)
    0 1 1 1 512
    1 2 1 2 512
    2 3 1 3 512
    3 4 1 4 512
    4 5 1 5 512
    5 6 1 6 512
    6 7 1 7 512
    7 8 1 8 512
    8 9 1 9 512
    9 10 1 10 512
    10 1 2 11 512
    11 2 2 12 512
    12 3 2 13 512
    13 4 2 14 512
    14 5 2 15 512
    15 6 2 16 512
    16 7 2 17 512
    17 8 2 18 512
    18 9 2 19 512
    19 10 2 20 512
    20 1 3 21 512
    21 2 3 22 512
    22 3 3 23 512
    23 4 3 24 512
    24 5 3 25 512
    25 6 3 26 512
    26 7 3 27 512
    27 8 3 28 512
    28 9 3 29 512
    29 10 3 30 512
    30 1 4 31 512
    31 2 4 32 512
    32 3 4 33 512
    33 4 4 34 512
    34 5 4 35 512
    35 6 4 36 512
    36 7 4 37 512
    37 8 4 38 512
    38 9 4 39 512
    39 10 4 40 512
    40 1 5 41 512
    41 2 5 42 512
    42 3 5 43 512
    43 4 5 44 512
    44 5 5 45 512
    45 6 5 46 512
    46 7 5 47 512
    47 8 5 48 512
    48 9 5 49 512
    49 10 5 50 512
    50 1 6 51 512
    51 2 6 52 512
    52 3 6 53 512
    53 4 6 54 512
    54 5 6 55 512
    55 6 6 56 512
    56 7 6 57 512
    57 8 6 58 512
    58 9 6 59 512
    59 10 6 60 512
    60 1 7 61 512
    61 2 7 62 512
    62 3 7 63 512
    63 4 7 64 512
    64 5 7 65 512
    65 6 7 66 512
    66 7 7 67 512
    67 8 7 68 512
    68 9 7 69 512
    69 10 7 70 512
    70 1 8 71 512
    71 2 8 72 512
    What I wanna do is to read all the data above and buffer them in a queue for each user( there are only 10 users in total).
    I already created a class called Class packet:
    public class packet {
        private int timestamp;
        private int user_id;
        private int packet_id;
        private int packet_seqno;
        private int packet_size;
        /** Creates a new instance of packet */
        public packet(int timestamp,int user_id, int packet_id,int packet_seqno, int packet_size)
            this.timestamp = timestamp;
            this.user_id=user_id;
            this.packet_id=packet_id;
            this.packet_seqno=packet_seqno;
            this.packet_size=packet_size;
    }then I wanna to create another Class called Class user which I can create a queue for each user (10 users in total) to store type packet information. the queue for each user will be in the order by timestamp.
    any idea and sample code will be appreciated.

    Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
    Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave.

  • Reading in a text file to GUI for later analysis

    Good Morning any and everyone,
    I'm trying to get a piece of code working to read in a text file and it isn't working very well. The code has been seriously crunched together from a multitude of sources so I suspect that the error has occurred from there.
    The errors that are occurring are "Can't Find Symbol" errors. Only 2 of them though which is a lot less than I had earlier. Now I'm just banging my head against the wall.
    Has anyone got any suggestions as to where I'm going wrong? Anything greatly appreciated.
    (PS> Please be gentle, I'm still a newbie)
    Thanks.
    import java.util.*; // required for List and ArrayList
    import java.io.*; // required for handling and IOExceptions
    import javax.swing.*;
    public class textAnalyser extends JFrame // implements ActionListener
        // the attributes
        // declare a TextArea
        private JTextArea viewArea = new JTextArea(10,55);
        // declare the menu components
        private JMenuBar bar = new JMenuBar();
        private JMenu fileMenu = new JMenu("File");
        private JMenu quitMenu = new JMenu("Quit");
        private JMenuItem selectChoice = new JMenuItem("Select");
        private JMenuItem runChoice = new JMenuItem("Run");
        private JMenuItem reallyQuitChoice = new JMenuItem("Really quit");
        private JMenuItem cancelChoice = new JMenuItem("Cancel");
        // declare an attribute to hold the chosen file
        private File chosenFile;
        // the constructor
        public textAnalyser()
            setTitle("Text Analyser"); // set title of the frame
            add(viewArea); // add the text area
            // add the menus to the menu bar
            bar.add(fileMenu);
            bar.add(quitMenu);
            // add the menu items to the menus
            fileMenu.add(selectChoice);
            fileMenu.add(runChoice);
            quitMenu.add(reallyQuitChoice);
            quitMenu.add(cancelChoice);
            // add the menu bar to the frame
            setJMenuBar(bar);
            // add the ActionListeners
    //        selectChoice.addActionListener(this);
    //        runChoice.addActionListener(this);
    //        reallyQuitChoice.addActionListener(this);
    //        cancelChoice.addActionListener(this);
            // configure the frame
            setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
            setSize(450,200);
            setVisible(true);
         public void actionPerformed(ActionEvent e)
                   if(e.getSource() == displayContentsChoice)
                        try
                             final int MAX = 300;
                             FileReader textFile = new FileReader("textfile.txt");
                             BufferedReader textStream = new BufferedReader(textFile);
                             int ch; // holds integer value of character
                             char c; // holds character when type cast from integer
                             int counter = 0; //counts number of characters read
                             ch = textStream.read(); //reads the first character from the file
                             c = (char) ch; //type cast from integer to character
                             viewArea.append("\n");
                             /*     continue through the file until either the end of the file or the maximum
                             number of characters allowed have been read*/
                             while(ch != -1 && counter <= MAX)
                                       counter++; // increment the counter
                                       viewArea.append("" + c); // display the character
                                       ch = textStream.read(); // read the next character
                                       c = (char) ch;
                             textStream.close();
                             viewArea.append("\n");
                   catch(IOException ioe)
                             if(chosenFile == null) // no file selected
                                       viewArea.append("No file selected\n");
                             else
                                  viewArea.append("There was a problem reading the file\n");
    }          

    A couple of points:
    *You've commented out stuff that is needed, like the adding of actionlisteners, the implements actionlistener,...
    *Your actionlistener is looking for a menu choice which doesn't exist  "displayContentsChoice".  Does this menu item need to be created?
    *How much of this code have you yourself created?  Do you understand its inner working?
    *What is the purpose of this code?  Is it for work?  School?  Homework?
    Good luck!
    /Pete

Maybe you are looking for