Okay? And your question would be ... ?
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Okay? So readLine with a counter. And? And you can't "write an Excel" with a standard filwwritier. Google "POI HSSF" and/or "Andy Khan jxl".
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
The starting line number and ending line number I would get from user in a textfield that could only contain string but how would i now convert it into a int and then make a search ?
Take a look at the API docs for the Integer class. As far as "making a search", like I said "readLine" (that's a method BTW) with a counter and then String's "contains" method (if looking for actual text).I am able to make an excel and write in it. coz I have added one more functionality in this , that is to search a string entered by the user in the textfield and then write the lines containing that string in an excel file .
Just help me solve the 1st part.
Just because you name the file whatever.xls doesnot make it an Excel. And what your code above does is write to a simple text file with an "xls" extension. That is not an Excel file, but if you want to believe otherwise, go ahead. And this talk of "additional functionality" does not support your argument that it is.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Well, if you know enough to be able to make a real xls file, then you should know enough to be able to put together the info about readLine, a counter, and contains to be able to do a search inside a file constraing that search between a specific set of line numbers (and help writing to the excel is also not need since you already know how to do so). But, once again, I can almost guarantee that you're still simply writing a text file (or maybe a csv as one step further that can, at least, actually be opened by excel and look like a spreadsheet, although it still isn't an excel file). Give it a try, and post your code, again, and we will help you to correct it.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
By counting the lines, that's why I mentioned a "counter".
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
I am sorry to say but this community is of no use ..no body gives straight forward answers ..rather all they do is taunt !!!!!
Your real problem is that no one gave you code. I gave you plenty of tips and hints (itis, after all, your (home)work), all you had to do was try. Take one attempt, and post that code, and we will be more than happy to give you further tips, but you have to implement those tips. No one "taunted" you. I simply pointed out that your claim of having produced an excel file was ludricous (with the code provided) and you provided no evidence to the contrary. Instead you continued to feign complete ignorance of the portion of the code you kept wanting provided to you. A piece of code, BTW, that is infinately easier than creating a "real" Excel file, and so should have provided no difficulty to you with the hints provided, given your claim of having successfully created an Excel file.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494