Windows Vista Forums

blank line in txt file problem
  1. #1


    MiroslavK Guest

    blank line in txt file problem

    ok, I'm using Add-Content to fill txt file, and that works great.
    However, I'm faceing the next problem: last line can't be blank line (swf
    file (SWIFT standard)). So, I need exeption for the last Add-Content command.
    Help please.



      My System SpecsSystem Spec

  2. #2


    Marco Shaw Guest

    Re: blank line in txt file problem

    MiroslavK wrote:
    > ok, I'm using Add-Content to fill txt file, and that works great.
    > However, I'm faceing the next problem: last line can't be blank line (swf
    > file (SWIFT standard)). So, I need exeption for the last Add-Content command.
    > Help please.


    I'm assuming you're using a script? Can you just do a final add-content
    file "" at the end of your script?

    Might need more details...

    Marco

      My System SpecsSystem Spec

  3. #3


    MiroslavK Guest

    Re: blank line in txt file problem

    "Marco Shaw" wrote:

    >
    > I'm assuming you're using a script? Can you just do a final add-content
    > file "" at the end of your script?
    >
    > Might need more details...
    >
    > Marco
    >



    I don't understand.
    Last line in my script is:

    Add-Content "-}"

    However, I'm getting swf (txt) file with end of file like this:

    ....
    ....
    ....
    -}
    (blank line)


    and "}" char need to be LAST char in the file.

      My System SpecsSystem Spec

  4. #4


    Roman Kuzmin Guest

    Re: blank line in txt file problem

    Try this
    [io.file]::AppendAllText('my.txt', '-}')

    --
    Thanks,
    Roman Kuzmin



      My System SpecsSystem Spec

  5. #5


    Keith Hill [MVP] Guest

    Re: blank line in txt file problem

    "Roman Kuzmin" <z@z.z> wrote in message
    news:OdkIFEUoHHA.4120@TK2MSFTNGP06.phx.gbl...
    > Try this
    > [io.file]::AppendAllText('my.txt', '-}')
    >


    It sure would be nice if Add-Content had a -NoNewline parameter.

    --
    Keith


      My System SpecsSystem Spec

  6. #6


    MiroslavK Guest

    Re: blank line in txt file problem

    "Roman Kuzmin" wrote:

    > Try this
    > [io.file]::AppendAllText('my.txt', '-}')
    >
    > --
    > Thanks,
    > Roman Kuzmin


    tnx, thats it!




    "Keith Hill [MVP]" wrote:

    >
    > It sure would be nice if Add-Content had a -NoNewline parameter.
    >
    > --
    > Keith


    great idea.

      My System SpecsSystem Spec

blank line in txt file problem problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read the LAST NON-BLANK line from a text file? Tony Bansten VB Script 18 18 Mar 2009
Blank uneditable Subject Line No One Vista mail 6 28 Dec 2008
Read a line from a text file, without loading the entire file inmemory Personne PowerShell 7 13 Dec 2008
How do I defeat Spam with a blank Subject Line? > as such >> Kaiser Vista mail 6 08 May 2008
reading a big file line by line to be "out of memory" safe freddy chavez PowerShell 8 02 Aug 2007