Please Help with text parsing problem

Hello,
I have the following text in a file (cut and pasted from VI)
12 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 ^M
12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 ^M
12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 ^M
12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 ^M
12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 ^M
12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 ^M
12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 ^M
this method reads the text from a file and stores it in a ArrayList
    public ArrayList readInData(){
        File claimFile = new File(fullClaimPath);
        ArrayList returnDataAL = new ArrayList();
        if(!claimFile.exists()){
            System.out.println("Error: claim data - File Not Found");
            System.exit(1);
        try{
            BufferedReader br = new BufferedReader(new FileReader(claimFile));
            String s;
            while ((s = br.readLine()) != null){
                     System.out.println(s + " HHHH");
                    returnDataAL.add(s);
        }catch(Exception e){ System.out.println(e);}
        return returnDataAL;
    }//close loadFile()if i print the lines from above ... from the arraylist ... here is waht i get ...
2 15 03 12 15 03 81 5 80053 1 1,2,3 $23.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 84550 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 84100 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 83615 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 82977 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 80061 1 1,2,3 $44.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 83721 1 1,2,3 $15.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 84439 1 1,2,3 $44.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 84443 1 1,2,3 $40.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 85025 1 1,2,3 $26.00 1 HHHH
HHHH
12 15 03 12 15 03 81 5 85008 1 1,2,3 $5.00 1 HHHH
HHHH
I see the ^M on the end of the lines ... but i dont understand why im getting the blank lines
in between each entry ... I printed "HHHH" just to help with debugging ... anyone have any ideas why i am getting the extra blank lines?
thanks,
jd

maybe its a FileReader deal.. Im not sure, maybe try using InputStreams. This code works for me (it reads from data.txt), give it a try and see if it works:
import java.io.*;
public class Example {
     public Example() throws IOException {
          BufferedReader b = new BufferedReader(new InputStreamReader(new FileInputStream("data.txt")));
          String s = "";
          while ((s = b.readLine()) != null) {
               System.out.println(s);
          b.close();
     public static void main(String[] args) {
          try {
               new Example();
          catch (IOException e) {
               e.printStackTrace();
}

Similar Messages

  • Please help with text boxes

    Can somebody help me wit hmy problem. I have a fom with many tables in it, some cells of the table are text boxes or at least they were when I developed it. Now I need to edit some of the cells and for some reason I cannot do it as the cell is not a text box but became (untitled<draw>) I cannot change its type back to text. Can some one advise what to do whitouh retyping text again in the new cell.
    Many thanks in advance

    You are welcome!
    I have a preference for Javascript (just get in the syntax zone) and use it for most things (except dates).
    As you know:
    this = current object
    rawValue = accesses the value of object
    From an Excel point of view FormCalc is similar and has inbuilt function like sum(), Max(), etc. Syntax is $ for current object and you don't need the rawValue. This is very handy when summing a column in a repeating table. Also FormCalc is excellent for working with time and dates. (not that you can't work around in Javascript, but it is heavier).
    Adobe have a very good reference for FormCalc at http://www.adobe.com/go/learn_lc_formCalc_82 and I would recommend that to you. I think it comes from the LC help file, but is easier to use.
    From a performance point of view, you can either have FormCalc in the calculate event of an object, which looks back at other fields (this will fire each time one of these fields changes). Alternatively you can have the FormCalc in the exit event of a field, which pushes a calculation/value forward to another object.
    Functions are handy if you have a script that you are using several times in a form. You write the script in a "script variable" and then call it in the objects events. HOWEVER, script variables are available in Javascript only.
    One last thing is that if you have a constant (like VAT), then rather than including  "* 0.21" in all of your calculations, use a global variable in the Form / Properties / Variables tab. currentVat = 0.21. Then in your calculations would be "* currentVat.value". If the VAT rate changes then you only have to change it in one location.
    In summary FormCalc is more akin to Excel; just watch the syntax.
    Good luck,
    Niall

  • Urgent Please help with a Conferencing problem in CUCM 6.1

    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}
    We have a configuration of CUCM 6.1. We have 24 voice ports (FXO) configured in H 323 registered with the call manger.  A CUE 3.2 configured for IVR and mail box. Gateway is a Cisco 3845 and the IOS version is 12.4(15) T10
    The problem is whenever a conference is configured with an outside number the FXO port is not releasing after the call disconnects.  It is not FXO disconnect problem. This happens only when a conference is taking place. There is no problem with any other outside or inside calls.
    I am attaching the configuration of Gateway. Please help me with the problem, I am very much thankful for you that.

    The Family pack covers upto 5 computers, other Install Disc cover one computer only.

  • Please help with an RMI problem

    Hi,
    This is probably a really simple problem which i can't spot, but i have the folloing 'HelloWorld' RMI program:
    The Client Program:
    import java.rmi.*;
    public class HelloClient {
         public static void main(String args[]) {
              if(System.getSecurityManager() == null) {
                   System.setSecurityManager(new RMISecurityManager());
              try {
                   HelloInterface obj = (HelloInterface)Naming.lookup("/HelloServer");
                   String message = obj.sayHello();
                   System.out.println(message);
                   Thread.sleep(10000);
              } catch (Exception e) {
                   System.out.println("HelloClient exception: " + e);
    }The Remote Interface:
    public interface HelloInterface extends java.rmi.Remote {
         public String sayHello() throws java.rmi.RemoteException;
    }The Server Program:
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.util.Date;
    public class HelloServer extends UnicastRemoteObject implements HelloInterface {
         public HelloServer() throws RemoteException {
              super();
         public String sayHello() throws RemoteException {
              return "Hello World, the current system time is " + new Date();
    }And finally the class which binds the object to the registery:
    import java.rmi.*;
    public class RegisterIt {
         public static void main(String args[]) {
              try {
                   HelloServer obj = new HelloServer();
                   System.out.println("Object instantiated: " + obj);
                   Naming.rebind("/HelloServer", obj);
                   System.out.println("HelloServer bound to registery");
              } catch (Exception e) {
                   System.out.println(e);
    }Now, this program works fine on my computer at home(XP!!!!!) but when i try to run it on the computers in college which run NT, it comes up with the following exceptions when i try to run RegisterIt:
    Java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    Java.lang.ClassNotFoundException: HelloServer_StubThis is saying that it cannot find the stub which is generated, but i use the folloing .bat file to load up the program:
    echo Creating remote object skelton classes....
    rmic -d . HelloServer
    start rmiregistry -J-Djava.security.policy=test.policy
    start java RegisterIt
    start java -Djava.security.policy=test.policy HelloClientThe stub is definitely created(it worked at home and i have checked in the directory and there are clearly the files HelloServer_Stub.class and HelloServer_Skel.class). The PATH is set correctly otherwise the registery would not be able to run correctly etc and therefore i am completely stuck as to why it doesn't work.
    Please help as it is very important for me.
    Many Thanks
    Cath

    I did not have any problem with Windows 2000 at all but only with Windows XP (and to think XP is a 2000 hybrid!).
    I have the same error: a ClassNotFoundException on the stub file.
    Any help will be appreciated. Thanks.

  • Please help with Nokia N95 problem.

    If anyone can help with this I’d be much appreciated, I have a N95 on contract with T-Mobile. When I try to play videos from myspace, or you tube etc… I get a message telling me the following.
    “Hello, Either you either have JavaScript turned off or an old version of macromedia's flash player click here to get the latest flash player”.
    I then get the option of clicking on a link within the previous sentence statement that directs me to acrobat downloads home page where I get the following message.
    “We are unable to locate a web player that matches your platform and browser. Please visit our table of recommended web players”
    This is deeply frustrating as in nearly every other way I feel the phone is perfect. If Any one can hep me fix this problem I’d be much appreciated.

    daperk,
    You should post this to board "Smartphones, Nseries and Eseries Devices".

  • Please help with column float problem in IE8

    Hi there,
    Sorry to be so pushy - but I am desperate for help!!
    Having serious problems with my site in some PC's showing Internet Explorer 8. My right column floated right is moving down the page underneath the left column..
    It shows fine on IE8 on my PC - however on my clients PC (vista with IE8) it is showing up as mentioned above. Is there a fix for this.
    Here is my link http://www.dooks.com/pgs/welcome.html
    The css is all there! If you need anything please let me know as I need to get this sorted - I have had serious issues with this site that I have never had before with other sites and am starting to think there is a bug in my software. I redid the index page and this one page (linked above) to see what my problems are - so help with query v appreciated.
    Many thanks,
    Karen

    Lawrence_Cramer wrote:
    A point to keep in mind is that IE8 is still in Beta.
    Not anymore.
    http://www.microsoft.com/Presspass/press/2009/mar09/03-18IE8AvailablePR.mspx
    "REDMOND, Wash. — March 18, 2009 — Today Microsoft Corp. announced the availability of Windows Internet Explorer 8, the new Web browser that offers..."
    Mark A. Boyd
    Keep-On-Learnin' :-)

  • PLEASE help with JavaScript parsing of WSDL return

    Can someone help with parsing return WSDL data?
    My return WSDL data is a concatenated string of alias names (firstname middlename lastname generation) delininated with an "@":
    7433|ALIAS|John|W|Smith| @7432|ALIAS|Johnny| |Smith| @7430|ALIAS|JJ| |Smithers| @7431|ALIAS|JJ| |Smith| @7400|ALIAS|Jon| |Smith| @7416|ALIAS|John|Wilber|Smith|JR
    I must have these names appear on my forms in a "lastname, firstname middlename generation" format. Can anyone provide expertise in this area if I provide the table.column reference?
    alias.alternate_id = tmp[0];
    alias.type = tmp[1];
    alias.firstname = tmp[2];
    alias.middlename = tmp[3];
    alias.lastname = tmp[4];
    alias.generation = tmp[5];

    Can someone help with parsing return WSDL data?
    My return WSDL data is a concatenated string of alias names (firstname middlename lastname generation) delininated with an "@":
    7433|ALIAS|John|W|Smith| @7432|ALIAS|Johnny| |Smith| @7430|ALIAS|JJ| |Smithers| @7431|ALIAS|JJ| |Smith| @7400|ALIAS|Jon| |Smith| @7416|ALIAS|John|Wilber|Smith|JR
    I must have these names appear on my forms in a "lastname, firstname middlename generation" format. Can anyone provide expertise in this area if I provide the table.column reference?
    alias.alternate_id = tmp[0];
    alias.type = tmp[1];
    alias.firstname = tmp[2];
    alias.middlename = tmp[3];
    alias.lastname = tmp[4];
    alias.generation = tmp[5];

  • Please help with card deck problem

    the class is supposed to create a shuffled deck of 52 cards
    it first is supposed to make an ordered deck of cards and then pull cards out of it and into another deck at random. when a card has been pulled, it is supposed to be taken out of the ordered deck. I say supposed to because for some reason a test of the class gives a strange runtime error:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 >= 1
    at java.util.Vector.elementAt(Vector.java:427)
    at Deck.<init>(Deck.java:17)
    at testDeck.main(testDeck.java:5)
    the following is the code:
    import java.util.*;
    public class Deck
      private Vector orderedDeck = new Vector(52);
      private Vector deck = new Vector(52);
      public Deck()
        //creates an ordered deck where rank and suit are the rank and suit of a Card variable
        for(int rank=0; rank<=12; rank++)
          for(int suit=0; rank<=3; rank++)
            this.orderedDeck.addElement(new Card(rank,suit));
        //supposed to shuffle the ordered deck into a final deck
        for(int i=0; i<53; i++)
          int randomNum = (int) (Math.random()*(this.orderedDeck.size()+1));
          this.deck.addElement(orderedDeck.elementAt(randomNum));
          this.orderedDeck.removeElementAt(randomNum);
    }please help me figure out my problem

         for(int i=0; i<53; i++)This should be:
         for(int i=0; i<52; i++)because you declared your array of size 52.
    -Eric

  • Please help with another card problem

    this one is a strange one(if you saw the other one you might understand this better) in any case, i am getting a error and i do not see the reason
    here is the code
      public Card getCard(int i)
        switch(i)
          case 1: return (Card) card1;
          case 2: return (Card) card2;
          case 3: return (Card) card3;
          case 4: return (Card) card4;
          case 5: return (Card) card5;
      }the compiler says that there is no return statement. i don not see the problem as there are five of them and all seem to be accessable.
    please tell me if i am not seeing something or have it all wrong.
    btw card1,card2,etc. are Card variables so that is not the problem. this method is supposed to return one of five cards according to the int that is passed to it.
    please help me!

    public Card getCard(int i)
    switch(i)
    case 1: return (Card) card1;
    case 2: return (Card) card2;
    case 3: return (Card) card3;
    case 4: return (Card) card4;
    case 5: return (Card) card5;
    }No, no, no. It's really very simple. Imagine this:
    Card c = getCard(42);
    c.someMethod();What is the value of 'c' after calling getCard()? And what happens when c.someMethod() is called?
    You see, the getCard() method does not have a return statement in all cases. A method that returns a value either must be absolutely guaranteed to execute a return statement in all cases, unless an exception in thrown.
    So the simplest thing you can do (or an array of cards might be in order here) is just add a default: case that throws an exception.
       public Card getCard(int i)
         switch(i)
           case 1: return (Card) card1;
           case 2: return (Card) card2;
           case 3: return (Card) card3;
           case 4: return (Card) card4;
           case 5: return (Card) card5;
           default: throw new IllegalArgumentException("Invalid card number " + i);
    Or, if you expect that in normal operation you'll be passing in values other than 1-5, instead of throwing an exception you could return null. But it sounds to me like in your case, it is a bug if a value other that 1-5 is ever passed in.

  • Please Help with background color problem in loaded .swf

    I am stuck!
    This is Flash CS4...
    I created a flash application which loads in many other little flash applications (.swf files) based on menu selections.
    When I change one of the little applications the changes are viewable except when I change the background color.
    After the first time I view the application, the background color changes do not carry over to the main app.  I run the little ones stand alone and they show the new color, then I run the main app and any other changes I have made are there but not the color change.  When I remove the file and the load fails, the old backround color still displays in the container movie clip the .swf was previously loaded into.
    I have tried several different options and the only thing that worked was renaming and copying and deleting and making a big mess.  There has to be a way to force a refresh of this mysteriously saved color. doesn't there?
    Please help!
    Thanks!
    Vivian

    Hi Antonia
    I am loading the swf into an instance of a movie clip:
    var myLoader:MovieClipLoader = new MovieClipLoader();
    myLoader.loadClip("Capitalization.swf",  contCapitalization);
    it is the background of Capitalization.swf that will not change
    this is AS 2 since the app was created before I upgraded
    Any ideas?

  • Please help with the versioncue problem.

    I know this is not the right place to post this but please, I need fast help. When I open a project in Photoshop CS3 it says "Cannot find the missing module blablabla versioncue.dll". I've searched around a little and found someone who said that 2 updates would fix it. I downloaded the updates but when I started to install it said "Can't find the product to update".
    For some extra info, I just reformated comp and I've considered it might be something about missing files or something and if so, can someone add [email protected] and send to me because this is important. This is also because I have a schoolproject where Photoshop will be needed.
    I'm also suspicious if I actually have the documents and settings files for CS3 since I only copied the whole files from programs when I reformated it.
    Please help!

    >since I only copied the whole files from programs when I reformated it.
    you need to do a full install from the original discs david. simply copying the files won't do it.

  • Please help with my post problems

    What and how you can recover the lost e-mail in Outlook Express??? 
      Missing mail for 3 months, one day took the incoming mail on the laptop, letters have been about 2500, the next day I come to work I open mail on your computer-no mail on the laptop also lost mail. Please help to recovery pst?

    Recovery ToolBox for Outlook to PST is a specialized tool for fast and efficient recovery of user data from corrupted Outlook PST files.
    http://www.outlook.recoverytoolbox.com/

  • Please help with text problem

    I am new to photoshop.  While going through one of the basic video tutorials, I came to the section where is says to add text.  I followed instructions, but can't see what I type.  My cursor looks different than the one in the video when I click into the layer with the text tool too.  I have a small square dot.  The video shows a normal text cursor, as you'd find in Illustrator.
    If I type something and click enter, it replaces the name of the layer, but is still not visible in the image.  The layer displays as a text layer.  What am I doing wrong?  Thanks.
    Chris.

    You mentioned you are new to Photoshop. When using the Type tool if, instead of clicking, you click with a tiny drag to the click you will see this symbol:
    Just delete it and try again. Good luck and welcome to Photoshop

  • Please Help with sql.Date problem

    I have spent alot of time on what I thought would be an otherwise simple task, and I beleive I am close to completion but I need some much needed help. I have posted various forms of my code to try and acheive the solution but the responses received have been limited.
    I am trying to delete a record from a MS Access database where a Date/Time field in the database (Err_Date) equals a date entered by the user via a textbox.
    I finally have gotten the correct record to delete from the database, but what is very strange is that Tomcat is throwing a 'java.lang.NullPointerException' error. Then when I re-open the database the correct record is deleted.
    Here is my code:
    <%@page import="java.sql.*"%>
    <%@ page import="java.text.SimpleDateFormat"%>
    <%@ page import="java.util.Date"%>
    <%
    Connection con = null;
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:errorlog", "admin", "");
    catch(Exception e){
         out.println(e.getMessage());
    ResultSet rs=null;
    Statement stmt=null;
    try {
    stmt=con.createStatement();
    String end = request.getParameter("To");//FROM TEXTBOX
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ("dd/MM/yyyy");
    java.util.Date d2 = df.parse(end);//CONVERT STRING TO UTIL DATE
    java.sql.Date date2 = new java.sql.Date(d2.getTime());//CONVERT TO SQL
    PreparedStatement stmnt = con.prepareStatement("DELETE FROM tblError WHERE Err_Date = ?");
    stmnt.setDate(1, date2);
    stmnt.executeUpdate();
    stmnt.close();          
    //CLOSE RESULT SET          
    rs.close();
         stmt.close();
    con.close();
    //CATCH EXCEPTIONS
    catch (SQLException e) {
         out.println(e.getMessage());
    %>

    well, in case anyone ever runs into a problem this stupid again the solution is as follows.
    the code to:
    1. retrieve date from text box
    2. covert string into util date
    3. convert util date into sql date
    4. delete from database
    is all correct.
    the problem is that I previously used String sql="SOME SQL DELETE" and then executed the result set, which of course I then had to close. This wasn't working so I switched to a Prepared Statement. I forgot to remove the 'rs.close()' statement in my code. So Tomcat was trying to close a result set that was never opened...

  • Can anyone please help with my G580 problems?

    These days my IdeaPad G580 has been showing serious problems: 1) I can't shut down the laptop by clicking the desktop button. Sometimes I may succeed by pushing the hardware button, but very often this won't help either. 2) I can't open the Skype app. Everytime I click on the Skype tile it just displays the blue colour for some seconds and then returns to the start menu. I have to uninstall and then install the app again. Yet the next time I try to open the app, the same problem arises. I can't just keep uninstalling and installing the app. What's more, similar problems appear when I try to open a PDF file with the windows reader application. And of course I cannot uninstall and install the reader app, so what should I do? 3) The windows app market cannot do updates. 4) I have accidentally refreshed my laptop and then I tried to restore the system. The system has been restored to a point which is exactly before I did the refreshing. So almost all my programs have been recovered - except my AUTHENTIC MS Office (which was installed with a CD-ROM)!! That's insane. But I have left my whole MS Office pack in my homeland. What can I do with this?? Please give me your feedback asap. I just bought the laptop not even a month ago. It's silly that so many problems arise.

    Have you looked under power options to see if it's configured to shut down when the button is pressed?  You can assign different actions in this menu, it may have been accidentally changed somehow.  Either that or a faulty power button?

Maybe you are looking for