files upload java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Josh
    New Member
    • Mar 2012
    • 12

    files upload java

    Hello,
    I have file.Data in the file are like this.

    Probable Cause: The network operator has issued an alter attribute command for invalid.
    Action Taken : The parameter value is changed from the old value to the newvalue is invalid.



    In above data,probable cause and action taken are the column of database table,and i have to store their value(after ":") in their respective column.The value are in the multiple line as you see in above sample.I wanted to retrieve the data from Probable Cause: to Action Taken and store in a variable.As the value is in multiple line so i'm getting trouble while reading through bufferedReader readLine() method.It reads one line at a time..

    Can someone help me,provide me the logic how should i do?

    Thanks in advance.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    If the value part will never contain a colon then read the value into a string until you encounter a line with a colon and don't include that line with the colon.
    You can split the column name from the value part using String.split(": ");

    Comment

    Working...