copy text from one file to another in dos

May 17, 2011 at 04:10:35
Specs: Windows XP
I want to find some data frrom text file and copy three lines following that data into another text file
pls. help

See More: copy text from one file to another in dos

Report •


#1
May 17, 2011 at 06:25:24
The syntax is:

more file.txt | grep "the text you want" > new_file.txt

If the destination already exists, then the syntax is:

more file.txt | grep "the text you want" >> exist_file.txt

How do you know when a politician is lying? His mouth is moving.


Report •

#2
May 17, 2011 at 13:53:24
I doubt he has posix grep installed.

1/3 of highway deaths are caused by drunks. The rest are by people who can't drive any better than a drunk.


Report •

#3
May 17, 2011 at 14:17:06
grep.exe is in C:\windows

How do you know when a politician is lying? His mouth is moving.


Report •

Related Solutions

#4
May 17, 2011 at 16:53:47
Just for fun I searched grep.exe on my XP Home. No dice - could it be an XP Pro only feature?

Please come back and let us know the outcome.


Report •

#5
May 17, 2011 at 17:36:46
Grep would come from either services for unix or a posix runtime (I forget that company).

1/3 of highway deaths are caused by drunks. The rest are by people who can't drive any better than a drunk.


Report •

#6
May 17, 2011 at 17:41:18
Derek, make sure that it's searching hidden folders too.

How do you know when a politician is lying? His mouth is moving.


Report •

#7
May 17, 2011 at 18:20:32
guapo

You mean there are folk who hide them in XP?
You'll be telling me they hide file extensions next LOL.

I did have protected system files hidden tho, but I unchecked and still no dice,
Looked in C:\Windows too. No matter - it was just my idle curiousity.

Please come back and let us know the outcome.


Report •

#8
May 17, 2011 at 18:25:44
I have never seen any MS dos or windows product come with grep.


http://social.msdn.microsoft.com/fo...

1/3 of highway deaths are caused by drunks. The rest are by people who can't drive any better than a drunk.


Report •

#9
May 17, 2011 at 19:13:22
I might have downloaded it then. I don't know why I would have it, otherwise.

http://www.wingrep.com/download.htm

How do you know when a politician is lying? His mouth is moving.


Report •

Ask Question