Re: Remove Lines in a text file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



string[] lines = myString.Split(Environment.NewLine)

now you have the lines, just choose and join the ones you want
Maybe there is a more optimal solution for this, but this should work fine.

"a" <a@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EFC48785-33AF-4C30-8860-F89B4126080F@xxxxxxxxxxxxxxxx
> I'm trying to remove specific lines from text files.
>
> I need to always remove lines 1 thru 8 and lines 10 and 11 from text
files.
>
> Seems like a simple task, but I'm not getting it.
>
> I'm reading the file via webresponse as a stream and then trying to remove
> the lines before parsing it and then writing it to an sql table.
>
> Any ideas on how I can accomplish the line removal/deletion?
>
> Thanks,
>
> Paul


.



Relevant Pages

  • Re: change date format
    ... (Hint: it ... has to do with 'string' data.) ... Prev by Date: ...
    (comp.lang.python)
  • removing item from dropdown list
    ... know the index of the item I want to remove or is just knowing the string ... Paul G ... Software engineer. ... Prev by Date: ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: Sorted Fixed Length String
    ... with Zeros Making it a 6 Digit String ... ... Re: Sorted Fixed Length String ... From: Paul Black ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: Andys off-topic comments
    ... > Yet, you but into a string, where you have nothing rational to add. ... You're a kOOk, Paul. ... Prev by Date: ...
    (misc.taxes)
  • Re: IOCTL_POWER_XXX method calls
    ... Paul G. Tobey wrote: ... declare them unsafe as a Char*, but declaring them as string might even ... work, since they're just string pointers, not embedded strings with fixed ... // in the managed array of bytes. ...
    (microsoft.public.dotnet.framework.compactframework)