Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

blank line in txt file problem

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 05-28-2007   #1 (permalink)
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
Old 05-28-2007   #2 (permalink)
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
Old 05-28-2007   #3 (permalink)
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
Old 05-28-2007   #4 (permalink)
Roman Kuzmin
Guest


 

Re: blank line in txt file problem

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

--
Thanks,
Roman Kuzmin


My System SpecsSystem Spec
Old 05-28-2007   #5 (permalink)
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
Old 05-28-2007   #6 (permalink)
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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
line space in log file systemtek VB Script 4 07-25-2008 01:49 PM
How do I defeat Spam with a blank Subject Line? > as such >> Kaiser Vista mail 6 05-08-2008 12:12 AM
reading a big file line by line to be "out of memory" safe freddy chavez PowerShell 8 08-02-2007 07:42 AM
new line in text file with out-file Did PowerShell 2 06-20-2007 08:40 AM
Line not found in INF file =?Utf-8?B?amhlbmFnZXI=?= Vista networking & sharing 4 09-12-2006 01:40 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51