TheCrimsonCrusader Posted January 15, 2011 Share Posted January 15, 2011 Greetings, When I run this simple batch command to output just the directory structure of the root of C:\, it leaves a blank line at the end of the text file: cmd.exe /c dir /b /ad c:\ > c:\rootdir.txt I wanted to remove that last blank line, so the actual last line is one where there is an actual directory name entry (as in, when I click on the last line of the text file, it's on that blank line instead of the last text entry being the last line). I did a search on the "StringStripCR", but I wasn't having any luck or wasn't understanding any of the scripts that would actually perform this task. Any help would be greatly appreciated and thanks advance! Link to comment Share on other sites More sharing options...
Bowmore Posted January 15, 2011 Share Posted January 15, 2011 One quick simple way of doing this to give you some ideas. Global $sData = FileRead("c:\rootdir.txt") FileDelete("c:\rootdir.txt") $sData=StringStripWS($sData, 2 ) FileWrite("c:\rootdir.txt",$sData) "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now