Help Me... ! String Problem
Hi ,
I have one text file with delimiter as dollar symbol which is imported from one text file.
Now I try to upload the data from this text file into oracle table. Everything inserted properly but one field 揕ocation? values not inserted properly.
The Original Data
1515$$HARRI SMITH$$23/08/2006$$ UNITED KINGDOM $$00:00:48$$23.40
1514$$John$$23/08/2006$$LONDON$$00:00:48$$ 23.40
The table shows like
codeNamedate LocationDuration cost
--
1514John23/08/2006LONDON00:00:4823.40
1515 HARRI SMITH23/08/2006UNITED KINGDOM 00:00:48
if the value of the "Location" is single word it comes properly.
The value of the "Name" come properly. even it has double value.
But Location only the problem when it is double value.
Please give me any one solution !
This is my part of the code :
BufferedReader inn =new BufferedReader(new FileReader("c:\\output.txt"));
while ((lines = inn.readLine()) !=null){
if (!(lines.equals(" "))){
if (!(lines.startsWith("--") || lines.trim().length() <=0 )){
if (!(lines.startsWith(" ") || lines.trim().length() <=0 )){
st =new StringTokenizer(lines,"$$");
code= st.nextToken();
name= st.nextToken();
date = st.nextToken();
location= st.nextToken();
duration = st.nextToken();
cost= st.nextToken();
pstmt = conn.prepareStatement ("insert into tele_report (code,name,r_date, ,location,duration,cost) values (?,?,?,?,?,?)");
pstmt.setString(1,code);
pstmt.setString(2,name);
pstmt.setString(3,date);
pstmt.setString(4,location);
pstmt.setString(5,duration);
pstmt.setString(6,cost);
Please can anybody help me.. !
Thanks
Merlin Roshina

