Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hello
Ive read a bit about reading and displaying a single line from a text file to the screen. But I'm after (if possible) to read a file copy a part of it and copy/inset it in to another file.So the data file is c:\datafile.txt:
---------- A.TXT
B.BBBBB?something.com.au DDDDD
and output c:\datafile2.txt
B.BBBBB?something.com.au
anyhelp would be great.

You've posted in the Win XP forum. Which version of Dos are you using or do you mean the Win XP Dos emulator program CMD.exe?

Hi Stphens,
Your post is not completely clear. It sounds almost as if you have been reading about Edlin (the old DOS command line editor.)
Have you tried doing whatever it is that you want to do by using Notepad, or MS Word, or one of the hundreds of freeware text editors which you can download from the web? Or, since you mention dot com dot au, are we talking about HTML? Please provide more info!
Pure gold does not fear the furnace.

Hi.
Sorry about not being clear..
Lets start again.I have a data file created with notepad called c:\datafile.txt in the datafile.txt it has the following data a few lines of information line 1 to 3 (line 3 is actually an email address and after that email address is a space than 5 charaters..
1.---------- A.TXT
2.
3.B.BBBBB?something.com.au DDDDD
EOFNow trying to run a process which will read the datafile (c:\datafile.txt) and output it to another file called c:\output.txt
in this format.B.BBBBB?something.com.au
EOF.I would perfer to be able to do this in DOS MODE running on a windows XP / 2000 2003 machine.
Is it possible to do it running dos command? -
I hope that this clears up what I'm trying to do.
thanks again.

This might be what you want:
@echo off setlocal cls for /f "tokens=1-2" %%# in (C:\datafile.txt) do ( echo %%#>c:\output.txt ) type c:\output.txt exit /b

![]() |
Drag and drop files corru...
|
reregistering jscript
|

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