![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Windows 2000 Pro / NT Workstation Support Find support for Windows 2000 Pro / NT Workstation here |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Oct 2009
Posts: 7
OS: Windows 2000 Pro Sp4
|
Use batch file to remove first line of text file
Hi - it's me again!
I didn't expect to be looking for assistance again so quickly but I have searched unsuccessfully for a script which will run through a directory and delete the first line of text in every txt file. I now know, or think I know, how to get the batch file to run through each file but I just can't figure out the coding I require to perform the actual deletion of the first line. Grateful thanks to anyone who can help! Dalgetty |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
TSF Enthusiast
Join Date: Mar 2009
Location: Portland, OR
Posts: 815
OS: MS-Dos 6.22 - Win7
|
Re: Use batch file to remove first line of text file
Code:
@Echo Off
Set _Path=C:\Test Dir1
PushD %_Path%
For /F "Tokens=1 Delims=" %%a In ('Dir /A-D /B *.txt') Do (
Echo %%a
For /F "Usebackq Tokens=1 skip=1 Delims=" %%I In ("%%a") Do >>"%temp%\%%a" Echo.%%I
Move /Y "%temp%\%%a" .\
)
PopD
__________________
Microsoft MVP - Windows Desktop Experience Of course I know all the answers; I just don't always match the answers to the right questions. Rated R for Violence -- When your PC flies through a window, that's violent, right? |
|
|
|
![]() |
| Thread Tools | |
|
|