Tony Docherty wrote:For example: If the number is always at the beginning of the line and is always followed by a " " character then you could find the index of "22 " and test to see if it is 0.
Vani Sweety wrote:no i dont have any classes
i am just reading from a file
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Vani Sweety wrote:the file is of 115 MB
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Vani Sweety wrote:and if i would like the user to input the searching value which might be any value how would i implement that
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Vani Sweety wrote:i would like that the user can input any id they want
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Carey Brown wrote:Unless I missed something, this thread seems to have gotten off on a tangent about regular expressions.
So, to clarify:
User's requested id:
22
Data in file:
Carey Brown wrote:Unless I missed something, this thread seems to have gotten off on a tangent about regular expressions.
If this is the case then regular expressions are overkill and equals() will suffice.
Of course this depends on splitting the line...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Vani Sweety wrote:but if there is an alternative method to do it as you mentioned i would like to learn it
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |