How to copy one line from a text document to clipboard using command prompt

Colin Newton

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?

Magoo
@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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I copy text to the clipboard using AppleScript

From Dev

How to copy text to / from clipboard in Go?

From Dev

in MySQL Command Line, how do I paste from the clipboard using only the keyboard?

From Dev

how to copy selected text to the clipboard using javascript

From Dev

How to copy text including special characters to clipboard using C and WinAPI?

From Dev

Copy to clipboard from php command line script in Windows 7

From Dev

How to copy text from a div to clipboard

From Dev

Copy text from CardView to Clipboard

From Dev

A command-line clipboard copy and paste utility?

From Dev

How to copy an entire command line to my clipboard, without the mouse?

From Dev

How to copy an image to the clipboard from a file using command line?

From Dev

A command-line clipboard copy and paste utility?

From Dev

How to copy text from command line to clipboard without using the mouse?

From Dev

How to copy an entire command line to my clipboard, without the mouse?

From Dev

How to copy an image to the clipboard from a file using command line?

From Dev

Command-line utility to copy file to clipboard from file path

From Dev

How to send rich text to the clipboard from command line?

From Dev

How to copy text from pentadactyl to system clipboard?

From Dev

How can I copy text to the clipboard using AppleScript

From Dev

How to copy text to Clipboard from TextField in Android

From Dev

how to copy/cut text from vim to system clipboard use line number

From Dev

How to copy text to the clipboard when using Wayland?

From Dev

How can I copy the output from a remote command into the local clipboard?

From Dev

How to pipe text from command line to the clipboard

From Dev

How to Send the Contents of a Text File to the Clipboard from the Command Line in OS X?

From Dev

How to copy a picture to clipboard from command line in linux?

From Dev

How to copy text in the Windows command line 'cmd'?

From Dev

Is it possible to copy a variable to the Shift+Insert clipboard from the command line?

From Dev

Using command line to copy html file to clipboard

Related Related

  1. 1

    How can I copy text to the clipboard using AppleScript

  2. 2

    How to copy text to / from clipboard in Go?

  3. 3

    in MySQL Command Line, how do I paste from the clipboard using only the keyboard?

  4. 4

    how to copy selected text to the clipboard using javascript

  5. 5

    How to copy text including special characters to clipboard using C and WinAPI?

  6. 6

    Copy to clipboard from php command line script in Windows 7

  7. 7

    How to copy text from a div to clipboard

  8. 8

    Copy text from CardView to Clipboard

  9. 9

    A command-line clipboard copy and paste utility?

  10. 10

    How to copy an entire command line to my clipboard, without the mouse?

  11. 11

    How to copy an image to the clipboard from a file using command line?

  12. 12

    A command-line clipboard copy and paste utility?

  13. 13

    How to copy text from command line to clipboard without using the mouse?

  14. 14

    How to copy an entire command line to my clipboard, without the mouse?

  15. 15

    How to copy an image to the clipboard from a file using command line?

  16. 16

    Command-line utility to copy file to clipboard from file path

  17. 17

    How to send rich text to the clipboard from command line?

  18. 18

    How to copy text from pentadactyl to system clipboard?

  19. 19

    How can I copy text to the clipboard using AppleScript

  20. 20

    How to copy text to Clipboard from TextField in Android

  21. 21

    how to copy/cut text from vim to system clipboard use line number

  22. 22

    How to copy text to the clipboard when using Wayland?

  23. 23

    How can I copy the output from a remote command into the local clipboard?

  24. 24

    How to pipe text from command line to the clipboard

  25. 25

    How to Send the Contents of a Text File to the Clipboard from the Command Line in OS X?

  26. 26

    How to copy a picture to clipboard from command line in linux?

  27. 27

    How to copy text in the Windows command line 'cmd'?

  28. 28

    Is it possible to copy a variable to the Shift+Insert clipboard from the command line?

  29. 29

    Using command line to copy html file to clipboard

HotTag

Archive