I need to be able to copy one line at a time from a text document to clipboard using command prompt.
Example I have a text document like this:
Line 1
Line 2
Line 3
etc...
Example: I need to be able to copy line 2 to clipboard and only line 2
What command would something like that be? or is there even a command like that?
@ECHO OFF
SETLOCAL
FOR /f "skip=1delims=" %%a IN (q27763354.txt) DO ECHO %%a|clip&GOTO done
:done
GOTO :EOF
I used a file named q27763354.txt
containing your data for my testing.
the number used as "skip" is one less than the line-number you want. skip=0
is invalid, omit the skip=0
if you want the first line from the file.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments