| Author |
using Regex
|
ramesh akula
Greenhorn
Joined: Mar 18, 2007
Posts: 1
|
|
hi i have one text document(*.txt) file it contains some rows and columns my requirement is that i have to remove some rows in that file for example : ( my text file contain the below data) --------------------------- N10 X-10.256 Y23.675 N11 X-23.563 Y45.078 N12 X34.567 N13 Y-56.774 N14 X-34.876 Y-23.878 F100 ---------------------------- i want to delete sequence numbers that is N10,N11,N12,N13,N14. so using REGEX can we do something ??? please helpme out
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16690
|
|
Ramesh, I would highly recommend that you pick up a book about regular expressions (or google for a tutorial). Regular expressions are incredibly powerful, and can't really be learned easily with examples. But to answer your question... assuming that you have one line of the file in a string, here is how regex can be used to remove the first field... Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16690
|
|
Okay, got a bit too fancy there. Here is a much simpler version... Henry
|
 |
 |
|
|
subject: using Regex
|
|
|