prince
01-27-2005, 10:28 PM
I am trying to capture a String from an Application and parse it and the substring obtained is modofied and passed as input to another application after modification.
For Example consider the string below:
String S= " *ABC{ abc bcd cda abz};#{twtr adscs ascdf hsfwo};#
AS1{abc;abc1;abc2;abc3;....}#;
AS2{bcd1;bcd2;bcd3;bcd4;...}#;
AS3{acd1;acd2;bcd3;...};"
My problem is.
1) am parsing the string using String Tokenizer with a delimitatior as #. But it seperates AS1 AS2 As3 aswell. Which i need as combined input for passing to other application. I must get
AS1{abc;abc1;abc2;abc3;....}#;AS2{bcd1;bcd2;bcd3;bcd4;...}#;AS3{acd1;acd2;bcd3;...};" together which am not getting. Please suggest.
2) I need to pass this dynamically to the other application so am writing the same on a file but after writing it on file and reading it am getting something like this.
String Sin="AS1{abc; abc1; abc2; abc3;....};"
Please notice the white spaces which is not desired and cannot be passed.
Please advise/suggest for any alternatives or solutions.
Thanks.
For Example consider the string below:
String S= " *ABC{ abc bcd cda abz};#{twtr adscs ascdf hsfwo};#
AS1{abc;abc1;abc2;abc3;....}#;
AS2{bcd1;bcd2;bcd3;bcd4;...}#;
AS3{acd1;acd2;bcd3;...};"
My problem is.
1) am parsing the string using String Tokenizer with a delimitatior as #. But it seperates AS1 AS2 As3 aswell. Which i need as combined input for passing to other application. I must get
AS1{abc;abc1;abc2;abc3;....}#;AS2{bcd1;bcd2;bcd3;bcd4;...}#;AS3{acd1;acd2;bcd3;...};" together which am not getting. Please suggest.
2) I need to pass this dynamically to the other application so am writing the same on a file but after writing it on file and reading it am getting something like this.
String Sin="AS1{abc; abc1; abc2; abc3;....};"
Please notice the white spaces which is not desired and cannot be passed.
Please advise/suggest for any alternatives or solutions.
Thanks.