Computing.Net > Forums > Programming > delete a line and data truncation

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

delete a line and data truncation

Reply to Message Icon

Name: Edof
Date: April 9, 2009 at 09:11:08 Pacific
OS: Windows 2000
Product: Dell / Poweredge server
Subcategory: Batch
Comment:

when I use MORE or TYPE command in my Windows batch script to remove the first line from a text file like this:

type Filename.txt | find /v "FILEHEADER" > Newfile.txt

it would remove the first line. But it would also truncate any data after position 1024 on a line when it writes to the newfile. What can I do (or what's the best way) to prevent this truncation?



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: April 9, 2009 at 09:25:06 Pacific
Reply:

It may be a limitation of TYPE but there's no need to use type in the first place.

find /v "FILEHEADER" < Filename.txt > Newfile.txt


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: ghostdog
Date: April 9, 2009 at 19:06:02 Pacific
Reply:

if you want to remove first line, you can also use the more command

c:\test> more +2 file > newfile

Unix Win32 tools | Gawk for Windows


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: delete a line and data truncation

Bat file to Delete a Particular Line..... www.computing.net/answers/programming/bat-file-to-delete-a-particular-line/19418.html

delete specified lines from array www.computing.net/answers/programming/delete-specified-lines-from-array/20089.html

Find a string and collect the next 3 digits www.computing.net/answers/programming/find-a-string-and-collect-the-next-3-digits/20180.html