Click here to Skip to main content
15,911,327 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have txt file i need to remove rows between specific text not using undex or line no.


example

hi
how
are
you
iam
fine
about


Now i want delete lines between "are" to "fine" in c#.

What I have tried:

Hi i need to remove text between specific. text
Posted
Updated 6-Mar-19 21:25pm
Comments
CHill60 7-Mar-19 2:01am    
What have you tried? Post the code that you are struggling with
krishnaraosan 7-Mar-19 2:14am    
Hi i havent tried iam new to c#.
CHill60 7-Mar-19 3:34am    
You will never learn C# if you don't start trying. We are not here to teach you I'm afraid. Give it a go, refer to your notes or your tutor. It's not particularly hard but you should write down how you think you might achieve it. Then write the code to match your plan. If you are still stuck then we will try to help.
OriginalGriff 7-Mar-19 2:01am    
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
krishnaraosan 7-Mar-19 2:15am    
Hi i havent tried iam new to c#.

1 solution

Quote:
Hi i havent tried iam new to c#.

Then you need to review your course materials, and start planning what you need to do. You've been here for ten years, so your existing dev skills should be directly transferable: define the problem, then start breaking it down into smaller tasks. If a smaller task is something you can do, fine - do it. If it isn't, break it down into yet smaller tasks and try again. At some point, you either get tasks you know how to do, or you get to something you need to research and find out about.
It's exactly the same process you have probably been using for ten years or more, just in a different language!

So start by deciding how to read the data - all at once or line by line - and how to output it, then you can start thinking about how to identify lines, and "remove" them as that will depend on the input and output choices.

You can do this, if you just think carefully first.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900