By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,876 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,876 IT Pros & Developers. It's quick & easy.

removing lines starting with #

P: 19
I hav a text file with N number of lines . i am able to read the file till the end .. in between many lines are starting with #. these lines starting with # are to be omitted. pleast help me in removing the lines starting with #
Mar 29 '07 #1
Share this Question
Share on Google+
1 Reply


Frinavale
Expert Mod 5K+
P: 9,731
I hav a text file with N number of lines . i am able to read the file till the end .. in between many lines are starting with #. these lines starting with # are to be omitted. pleast help me in removing the lines starting with #
While you're reading 'til the end...check to see if the String you're grabbing Contains "#". If so, skip it...or delete it...or do what ever you need to do to it.

-Frinny
Mar 29 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.