Unable to find out a string
sir there is a .Dat file in my system.
i want to read that file from a String upto the end of the file .
the string is "Next" which is in the .Dat file
here is the code please if any one could help me out
import java.io.BufferedReader;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class htmlpageparse
public static void main(String args[])throws Exception
int cmt;
FileReader fr=new FileReader("ser.dat");
BufferedReader br=new BufferedReader(fr);
FileWriter fw=new FileWriter("ser3.dat");
BufferedWriter bw=new BufferedWriter(fw);
String samp;
String cmp="Next";
StringBuffer str=new StringBuffer("Next");
while((samp=br.readLine())!=null)
if(samp.startsWith(cmp))
System.out.println(br.readLine());
while(br.readLine()!=null)
bw.write(br.readLine());
bw.flush();
}please send me a rectified code
System.out.println(br.readLine());You're reading one line, check it, read another and print it out... I think you want to read only once on each iteration.
Similar Messages
-
Find out varchar2 string NULL columns and Empty columns
Hi dev's ,
my requiremnt is to find out the string columns Names of whose storing NULL values and EMPTY strings. for that i had written below code. it's getting some error.
SET ECHO OFF;
SET FEEDBACK OFF;
SET SERVEROUTPUT ON;
SET VERIFY OFF;
SET PAGES 0;
SET HEAD OFF;
spool D:\stringnull.csv
DECLARE
v_tab_indent NUMBER(5);
v_col_indent NUMBER(5);
v_val1 VARCHAR2(20);
v_val2 VARCHAR2(20);
v_query1 VARCHAR(500);
v_query2 VARCHAR(500);
BEGIN
--DBMS_OUTPUT.ENABLE(100000);
SELECT MAX(LENGTH(table_name))+1,MAX(LENGTH(column_name)) +1
INTO v_tab_indent,v_col_indent
FROM user_tab_columns
WHERE data_type='VARCHAR2';
FOR i IN
(SELECT table_name,
column_name
FROM user_tab_columns
WHERE data_type IN ('NVARCHAR2', 'CHAR', 'NCHAR', 'VARCHAR2')
ORDER BY table_name,
column_name
LOOP
v_query1:='SELECT NVL('||i.column_name||',0) AS VAL
FROM '||i.table_name||' where '||i.column_name||' IS NULL';
v_query2:='SELECT '||i.column_name||' AS VAL
FROM '||i.table_name||' where '||i.column_name||'=''''';
--dbms_output.put_line(v_query1);
-- dbms_output.put_line(v_query2);
EXECUTE immediate v_query1 INTO v_val1;
EXECUTE immediate v_query2 INTO v_val2;
dbms_output.put_line (rpad(i.table_name,v_tab_indent,' ')||','||rpad(i.column_name,v_col_indent,' ')||' ,'||v_val1||','||v_val2);
END LOOP;
END;
Spool OFF
Set echo on
Set feedback onERROR:
Error report:
ORA-01403: no data found
ORA-06512: at line 31
01403. 00000 - "no data found"
*Cause:
*Action:
set feedback onpls help me on this issue..
Thanks,Example:
SQL> DECLARE
2 v_val VARCHAR2(20);
3 v_query1 VARCHAR(32767);
4 BEGIN
5 FOR i IN (SELECT table_name, column_name FROM user_tab_columns
6 WHERE data_type IN ('NVARCHAR2', 'CHAR', 'NCHAR', 'VARCHAR2')
7 ORDER BY table_name, column_name
8 )
9 LOOP
10 v_query1 := 'SELECT count(*) FROM '||i.table_name||' where '||i.column_name||' IS NULL';
11 EXECUTE immediate v_query1 INTO v_val;
12 dbms_output.put_line(rpad(i.table_name,30,' ')||' : '||rpad(i.column_name,30,' ')||' : '||v_val);
13 END LOOP;
14 END;
15 /
CHILD_TAB : DESCRIPTION : 0
DEPT : DNAME : 0
DEPT : LOC : 0
EMP : ENAME : 0
EMP : JOB : 0
MYEMP_OLD : ENAME : 0
MYEMP_OLD : JOB : 0
MYNULLS : ENAME : 0
MYNULLS : JOB : 4
PARENT_TAB : DESCRIPTION : 0
T : CHAR_VALUE : 0
TABLE1 : COL1_DESC : 0
PL/SQL procedure successfully completed. -
Hi, Last time I synced my IPad with my PC, it (unknown to me) migrated all my PC "Favorites" (about 100 folders) to the ICloud.
I have searched and so far been unable to find out how to recover my "Favorites" from the ICloud back to my PC. Any advice would
be appreciated. Thank you.What did you do to get them synced to the Cloud. Would that procedure help me get my favorites synced to my iPad2?
-
How can I find out the strings that will be presented to the UI
Hi All,
I am working on a Swing based application (Swing based UI)
I am requested to do the following on the bytecode of that application:
I am supposed to find out what strings from within that bytecode will be presented to the UI and what will be used for an internal usage.
i have no way of running the application to verify that, i can only work on the static bytecode files.
hard question ha?
Thanks,
EItan.You would of course have to run it. Either via a VM or recreating a VM yourself.
As an example of that how would you figure out what string occurs in the following (pseudo) code?
String msg = (cnt > 1) ? ("files=" + cnt) : ("file=" + cnt);
if (cnt > 1) DisplayMessage(msg); -
Brand new lap top. Unable to find out how to launch or use the webcam. It is not listed anywhere under control pannel. Any ideas how to launch it?
ThanksThe software used to launch webcam is Cyberlink youcam installed on the Notebook. You can search for it in Start menu under All Programs.
//Click on Kudos and Accept as Solution if my reply was helpful and answered your question//
I am an HP employee!! -
hi all
need help to solve this problem
In a file called AllBalancedOfSize.java write a method with the signature:
public void printBalanced(int len)
that uses recursion (either directly or indirectly) and prints all balanced strings, composed solely of the characters a and b of length len in lexical (dictionary) order. A balanced string is a string with an equal number of a and b characters. So, for example, abab is a balanced string and bbab is not a balanced string.
As an example, the call printBalanced(4) must print:
aabb
abab
abba
baab
baba
bbaa
A call printBalanced(5) must print nothing because there are no balanced strings of length 5 (same for any odd parameter value). A call printBalanced(0) must print an empty line because there is one balance string of length zero, the empty string! You may assume that len is always greater than or equal to zero.
i have done this
public class AllBalancedOfSize {
public static void main(String[] args) {
AllBalancedOfSize q4 = new AllBalancedOfSize();
q4.printBalanced(4);
public void printBalanced(int len) {
if (len == 0) {
System.out.println();
} else {
if (len % 2 == 0)
printBalanced(len, "");
public void printBalanced(int len, String prefix) {
if (len == 0) {
int numofa = 0, numofb = 0;
for (int i = 0; i <= prefix.length(); i++) {
char tmp = prefix.charAt(i);
if (tmp == 'a') {
numofa++;
} else {
numofb++;
if (numofa == numofb) {
System.out.println(prefix);
} else {
printBalanced(len - 1, prefix + "a");
printBalanced(len - 1, prefix + "b");
}but i got this from compiler
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 4
at java.lang.String.charAt(String.java:687)
at AllBalancedOfSize.printBalanced(AllBalancedOfSize.java:20)
at AllBalancedOfSize.printBalanced(AllBalancedOfSize.java:31)
at AllBalancedOfSize.printBalanced(AllBalancedOfSize.java:31)
at AllBalancedOfSize.printBalanced(AllBalancedOfSize.java:31)
at AllBalancedOfSize.printBalanced(AllBalancedOfSize.java:31)
at AllBalancedOfSize.printBalanced(AllBalancedOfSize.java:12)
at AllBalancedOfSize.main(AllBalancedOfSize.java:4)
need help to find out what is the error.
Edited by: dttl on May 10, 2009 11:44 AMdttl wrote:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 4
at java.lang.String.charAt(String.java:687)
need help to find out what is the error.When a String has a length of 4 characters, you can access them though indexes 0 through 3.
When a String has a length of N characters, you can access them though indexes 0 through N-1. -
Unable to find out asdm image file cisco asa
Hello,
i am using cisco asa in gns 3 simulator ,unable find out the ASDM image or .bin file in
ASA flash .If not how can i
Uploade the ASDM image onto the ASA flash.
Please help me outFollow this:
http://www.xerunetworks.com/2012/03/asa-84-asdm-on-gns3-step-by-step-guide/
For Networking Posts check my blog at http://laguiadelnetworking.com/
Cheers,
Julio Carvajal Segura -
Unable to find out the Exception
Hi,
I have a created a generic method to read value from the Dropdown UI element, but i am getting some exception and un able to find out what kind of exception i am getting and which line of code causing the problem, i am giving the peace of code , could any body tell me why the below method throwing exception?
public java.lang.String readValueFromDropDown( java.lang.String attributeName, java.lang.String contextNodeName )
//@@begin readValueFromDropDown()
IWDAttributeInfo attribute = null;
String attrValue="";
try{
IWDNode node= wdContext.getChildNode(contextNodeName,1);
IWDNodeInfo rootNode =wdContext.getNodeInfo();
Iterator iterationNodes = rootNode.iterateChildren();
//Vector
Vector mainVector,tempVector1,tempVector2;
mainVector = new Vector();
tempVector1= new Vector();
tempVector2 = new Vector();
boolean isContentNodeFound= false;
while(iterationNodes.hasNext()){
tempVector1.add((IWDNodeInfo)iterationNodes.next());
do{
int k=0;
int temp1VectorSize=tempVector1.size();
for(int i=0;i<tempVector1.size();i++){
IWDNodeInfo tempNodeInfo =(IWDNodeInfo)tempVector1.elementAt(i);
mainVector.addElement(tempNodeInfo);
if(tempNodeInfo.getName().equalsIgnoreCase(contextNodeName)){
isContentNodeFound=true;
ISimpleTypeModifiable smpMod = attribute.getModifiableSimpleType();
IModifiableSimpleValueSet valueSet = smpMod.getSVServices().getModifiableSimpleValueSet();
IWDNodeElement nodeElement = node.getCurrentElement();
attrValue =valueSet.getText(nodeElement.getAttributeAsText(attributeName));
break;
for(Iterator iterationChildsTemp2=tempNodeInfo.iterateChildren();iterationChildsTemp2.hasNext();){
tempVector2.addElement((IWDNodeInfo)iterationChildsTemp2.next());
k=k+1;
if(tempVector1.size()== k){
tempVector1.removeAllElements();
for(int j=0;j<tempVector2.size();j++){
tempVector1.addElement(tempVector2.elementAt(j));
}while(tempVector2.size()>0 || isContentNodeFound);
if(!isContentNodeFound){
attrValue="not found";
else if(isContentNodeFound && attrValue.equals("")){
attrValue="found but no value returned";
}catch(Exception e){
// wdThis.wdGetFcVndUtilityInterface().logAndReportException(READVALUEFROMDROPDOWN,e,INTERFACENAME);
attrValue="Exception";
wdContext.currentApproverDetailsElement().setApproveRejectReason("Exception");
}finally{
return attrValue;
//@@endWrong place!
Place this question in WebDynpro-java forum
-Ashutosh -
My Master server is stopping automatically unable to find out the issue
Dear Experts,
My Master server in CMC is stopping automatically and is going to infinite stop state.when i again restart manually its connecting but again it is stopping.what may be the cause unable to find the solution
Thanks in Advance,
Regards,
Vinay.GGo to the Tomcat site and read the "First Web App" docs. I'm sure you didn't deploy your servlet properly.
% -
I am trying to find out how I can download version 11.1 or higher on iTunes for my iPhone. Can someone help?
Its not iTunes on your phone that needs to be updated - its iTunes on your computer.
Start iTunes on your PC/Mac and it should prompt you. -
Unable to find out remaining data from website or My Verizon - anyone else?
For the last few days I have been unable to check data usage from either the Verizon website by logging in or from My Verizon on my phone - it gives a very useless "readout" but there's no way to determine how much data I have. Guess this has been since the prepaid "system upgrade" a week ago. Is this the case with everyone and does anyone have ANY idea when this will be resolved? I just can't face calling customer service.
A work-around is to call #3282 from your prepaid phone - it does tell you remaining data. I have to assume that it's correct.I'm in the same boat. I switched from postpaid to prepaid and it just shows my postpaid acct. Myverizon app is usless I can't even log in or register with it...
-
Unable to Find out Advanced Function in Mapping
Hi Experts,
We Installed PI 7.0.
Here In IR --> Mapping
If I Want to Create Any Adv User Defined Function Means , that option is not there.
Only i have One Click on that Button.
I don't have the Other Option of Having the ADV Functions to Create.
Please Let Me Know
Regards
KhannaHi
go thru the following
Activities
1. To create a new user-defined function, in the data-flow editor, choose Create New Function (This graphic is explained in the accompanying text), which is located on the lower left-hand side of the screen. In the menu, choose Simple Function or <b>Advanced Function.</b>
2. In the window that appears, specify the attributes of the new function:
Name
Technical name of the function. The name is displayed in the function chooser and on the data-flow object.
Description
Description of how the function is used.
Cache
Function type (see above)
Argument Count
In this table, you specify the number of input values the function can process, and name them. All functions are of type String.
3. In the window that appears, you can create Java source code:
a. You can import Java packages to your methods from the Imports input field, by specifying them separated by a comma or semi-colon:
You do not need to import the packages java.lang., java.util., java.io., and java.lang.reflect. since all message mappings require these packages and therefore import them. You should be able to access standard JDK and J2EE packages of the SAP Web Application Server by simply specifying the package under Import. In other words, you do not have to import it as an archive into the Integration Repository. You can also access classes of the SAP XML Toolkit, the SAP Java Connector, and the SAP Logging Service (see also: Runtime Environment (Java-Mappings)).
In addition to the standard packages, you can also specify Java packages that you have imported as archives and that are located in the same, or in an underlying software component version as the message mapping.
b. Create your Java source text in the editor window or copy source text from another editor.
4. Confirm with Save and Close.
5. User-defined functions are limited to the message mapping in which you created the function. To save the new function, save the message mapping.
6. To test the function, use the test environment.
The new function is now visible in the User-Defined function category. When you select this category, a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the function to the data-flow editor, choose the arrow next to the button and select from the list box displayed.
regards
krishna -
Unable to Find out Adapter Engine in the Communication Channel
Hi Experts,
I am Unable to select the Adapter Engine As Integration Server in the File Sender Communication Channel.
Please Let Me Know
Regards
KhannaHI Khanna
Check the SLD that Adapter Engine is insatlled and all the adapter has the metadata there.
Go to Transaction Code SXI_CACHE in the Inetgration Server(XI- ABAP stack) Then you can see the list of components.
Just have a look into Menu Bar - in there goto : GoTo->Adapter Engine Cache ( if the status is green - then it is correct-otherwise you need to refreshit.)
You just go thru mentioned document from service.sap.com/nw04
You will get the full info about that.
/people/michal.krawczyk2/blog/2005/09/07/xi-why-dont-start-searching-for-all-errors-from-one-place
/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions
http://help.sap.com/saphelp_nw2004s/helpdata/en/0d/28e1c20a9d374cbb71875c5f89093b/frameset.htm
Just try with Visual Administrator to check the services for the adapter engine are running or not
All services starts with SAP XI..
SAP XI AF Core
SAP XI AF CPA Cache
SAP XI AF Messaging
SAP XI Adapter XI
SAP XI AF Security
Check SAP note on CPACache- 741214 and also 824236.
Let me know if any errors..
Cheers..
Vasu
<i>** Reward Points if found useful **</i> -
I am unable to find out how much and what type RAM is supported by HP ( DV6610eo ) laptop
Hi i want to buy more RAM to my laptop but i am unsure if the motherboard will support 2GB or 4GB and what type, i think it'sDDR2 PC5300 SO DIMM 200pin but again i am not sure, bellow are the details from the service tag, i would be grateful if some one could help me with this before i buy the memory upgrade.
DV6610eo
S/N CNF7444MFY
P/N KB342EA#UUW
Best regards
JuhaMaximum memory is 4GB.
Be sure and purchase only guaranteed compatible RAM.
Here is a link to a search that I did.
Best regards,
erico
****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
2015 Microsoft MVP - Windows Experience Consumer -
Find out if string is valid file name?
Is there a platform-independent method in the standard API to determine if a string contains only valid filename characters, and if not, convert it?
How about something like
File f = new File(String pathname)
then
if(f.isDirectory())
And
if(f.isFile())
And
if(f.exists())This would only work for existing files. You could try File.exists() as a first effort, and if this returned false, try creating a new directory with File.mkdirs(). Of course, this only works for local code (i.e. it wouldn't work in an Applet), and wouldn't work (for example) if the path contained a drive letter that didn't exist on your machine.
RObin
Maybe you are looking for
-
IPad 3 crashes when adding photo from gallery
Major bummer. I've had my new ipad3 for about a week. Just today when I try and add a photo to either a chat or to Facebook it crashes before it pulls up my photo gallery. This is awful. Anyone else experiencing this? What can I do besides shutting o
-
2 Problems with PDF Forms: Import and Launcing PDF Form in Browser
We are installing SAP sersion 2004s and I have encountered 2 problems while working through several tutorials. 1. When Adobe Designer opens from the layout in SE80, the IMPORT option (under TOOLS) does not appear. Is there an installation step(s) m
-
Can't put key back into keyboard?
I can not snap my key back into place I can only get the top portion of the key in place, it does not seem like there is damage, am I doing something wrong?
-
My Ipod keeps freezing! help please!
So I got my new iPod nano for Christmas and I loaded all the songs I wanted on it and everything went well with loading the songs on it and I started listening to it and the iPod will randomly freeze in the middle of a song and either stop in the pla
-
Reference Doc (Field - LFBNR) against IV cancellation - EKBE table
Hi, We want to refer to table - EKBE, for getting a link between the original IV (Material Doc) with the cancellation (Material) IV Doc. At my earlier site, our cancellation (Material) IV Doc was getting updated as a "Reference Doc" against the Origi