| 1. |
Solve : Inserting Blank Lines in a set of text files? |
|
Answer» Hi, If all you need is a blank line on the end of all files in a folder then type this in at the command line Hi, thanks alot for ur reply.. yes for sure i would want an explanation as im not much into scri[pting so i really dont knw how to go about doin this. please assist me.I get the impression that you are not sure even how to get to the command prompt ? In the start menu, click on Run and then enter cmd and press return. If you find yourself using the command prompt a lot, then there is a useful microsoft tool that adds a new option to the right-click contect menu in windows explorer called 'Command Prompt Here' which opens up a command window in the selected folder http://gallery.technet.microsoft.com/ScriptCenter/en-us/d50e36fd-0454-4df1-aa35-3416f44789cc however as even microsoft do not guarantee this for VISTA or win 7, I would hold off for now. When the command window opens, you need to go to the folder that you wish to process the files in: Code: [Select]cd /d "x:\PATH\to my files"the x: refers to the disk drive the files are on (if a network drive, it needs to be mapped to a drive letter) and \path\to my files refers to the folder on the drive that contains the files. the quotes around the drive and folder name are important if the path might contain spaces, it doesnt hurt to include them. CD is the command to change directory (folder) the /d parameter tells it to change the drive too. Now for the command I told you to type in .... the first PART Code: [Select]For %A in ("*.*") dosets up a loop to look at all of the files in the current folder (thats the *.* part). The %A is a variable that for each iteration will hold the filename. The last part is what we do with each file Code: [Select]Echo. >> %AEcho is used to send a message to the screen, however you can send the message to a file (or the printer or comm port) by using the > and >> 'redirection' symbols. > will replace the file, while >> tacks the message on to the end. Echo on its own give the (not very) useful message 'Echo is on' - or off. Adding the dot to the end makes it send a blank line And thats all there is to it. I recommend that you try stuff out, read the various help guides on this site and others and come back when you are stuck. Good luck Graham Thanks alot gpl It has solved my problem!To follow up my previous post, I have stumbled across this with regasrd to opening a command window in Vista and I assume Win 7 also "Open Command Window Here" in Vista It is now easy to open a command prompt referenced to a folder of your choice in Vista. If the Shift key is held down while right-clicking a folder, the context menu will contain an entry, "Open Command Window Here". Selecting this entry will open a command prompt with the chosen folder as the reference point for commands. You live and learn!! |
|