How can I copy the line of a textfile if the text meghana is in it
from C:\dos\crusoe\src.txt and paste it in C:\dos\crusoe\trgt.txt
|
| ||||
|
feedback
|
migrated from stackoverflow.com Sep 14 '09 at 14:45
This question came from our site for professional and enthusiast programmers.
|
I believe on Windows you'd be looking for For example:
| |||||
feedback
|
|
I could write a .bat file that would do what you asked. However, what is it that you really want to do? A routine to copy the third word (space-delimited string of characters)? A routine to copy that particular word? Something more complex and/or flexible? Also, I find doing this kind of processing in batch files to be awkward and inconvenient. I would strongly recommend looking into using a programming language (even just VB Script) to do this kind of work. | |||
feedback
|
|
You might want to have look at awk. A GnuAwk version is available for DOS or Windows. If you just want to copy every third word in each line of a file you can use a simple script:
You would then execute the script as follows:
| |||
|
feedback
|
|
Get mingw32 and use sed. Or, use the windows alternative: copy it out on a piece of paper and write it back... | |||
feedback
|
|
Write a program to read your textfile data.txxt and copy the content within data1.txt | |||
|
feedback
|
