Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


Sign in to follow this  
Followers 0
kali

How delete text line by Command prompt

4 posts in this topic

I can make text file with command prompt and also add text to a file. But how to delete text line from text file I don't know. Is there any way to delete text line with DOS.

0

Share this post


Link to post
Share on other sites

I can make text file with command prompt and also add text to a file. But how to delete text line from text file I don't know. Is there any way to delete text line with DOS.

Yes/No.

Meaning that it is possible NOT to delete a line of text from a "plain txt" file, but it is possible to re-create the text file excluding a given line.

There are two basic approaches, using FIND or FINDSTR (possibly with the /V parameter) to filter out some specific content or use MORE and FOR loops with ECHO (but you might need a batch file).

There might be issues with "unicode" and with "special characters"including leading spaces, though.

JFYI, there is NO real "DOS" in XP, there is it's Command Prompt (which uses a different command processor cmd.exe, than the actual DOS command processor command.com).

It's similar, but not exactly the same.

In any case the "default" programs are "limited", and you might find more useful adding a third party tool, like SED, see also this:

jaclaz

P.S.: Oops, cross-posting with allen2 :blushing:

Edited by jaclaz
0

Share this post


Link to post
Share on other sites

Meaning that it is possible NOT to delete a line of text from a "plain txt" file, but it is possible to re-create the text file excluding a given line.

There are two basic approaches, using FIND or FINDSTR (possibly with the /V parameter) to filter out some specific content or use MORE and FOR loops with ECHO (but you might need a batch file).

There might be issues with "unicode" and with "special characters"including leading spaces, though.

Thanks jaclaz.

I found same informations in online searching you wrote above. I'll follow your re-create text file. Thanks alos allen2.

0

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.