Questions tagged [paste]

The paste tag is to be used for issues relating to the paste portion of copy/paste operations.

paste
Filter by
Sorted by
Tagged with
259 votes
26 answers
235k views

Eclipse copy/paste entire line keyboard shortcut

Anyone know the keyboard shortcut to copy/paste a line into a new line in Eclipse, without having to highlight the entire line? ctrl-alt-down turns my whole screen upside down (I'm on windows). ...
Prabhu's user avatar
  • 13.2k
219 votes
17 answers
264k views

Catch paste input

I'm looking for a way to sanitize input that I paste into the browser, is this possible to do with jQuery? I've managed to come up with this so far: $(this).live(pasteEventName, function(e) { // ...
Christoffer Winterkvist's user avatar
209 votes
13 answers
299k views

Combine several images horizontally with Python

I am trying to horizontally combine some JPEG images in Python. Problem I have 3 images - each is 148 x 95 - see attached. I just made 3 copies of the same image - that is why they are the same. My ...
edesz's user avatar
  • 12.1k
167 votes
4 answers
308k views

Get current clipboard content? [closed]

I'd like to know a way to make my script detect the content of the clipboard and paste it into a text field when the page is opened, with no input from the user. How can it be done?
kettlepot's user avatar
  • 10.8k
155 votes
11 answers
66k views

Getting strange characters when pasting into my iterm2 terminal

I'm using iterm2 v 3.0.15 on Mac Sierra. I'm having trouble cutting and pasting from other places (e.g. text on a web page) into my terminal. For instance, I highlight some text from a web page, ...
user avatar
146 votes
13 answers
168k views

How do I paste multi-line bash codes into terminal and run it all at once?

I need to paste a multi-line bash code into terminal, but whenever I do, each line gets run as a separate command as soon as it gets pasted.
Nathan's user avatar
  • 1,463
129 votes
11 answers
163k views

Paste multiple columns together

I have a bunch of columns in a dataframe which I want to paste together (seperated by "-") as follows: data <- data.frame('a' = 1:3, 'b' = c('a','b','c'), '...
user1165199's user avatar
  • 6,531
122 votes
11 answers
33k views

Replace word with contents of paste buffer?

I need to do a bunch of word replacements in a file and want to do it with a vi command, not an EX command such as :%s///g. I know that this is the typical way one replaces the word at the current ...
plong's user avatar
  • 1,733
118 votes
8 answers
40k views

Paste multiple times

What is the best way replace multiple lines with the contents of the clipboard? The problem I'm having is when I yank a line and paste it over another line the "yank" is replaced with the line I ...
jwerre's user avatar
  • 9,404
91 votes
10 answers
215k views

jQuery bind to Paste Event, how to get the content of the paste

I have a jquery token tagit plugin and I want to bind to the paste event to add items correctly. I'm able to bind to the paste event like so: .bind("paste", paste_input) ... function ...
AnApprentice's user avatar
84 votes
5 answers
111k views

How to paste to Vim when using PuTTY

I am using PuTTY to connect a remote host and editing via Vim. I meet a trouble when I try to paste something to Vim. That is, I copy something to the clipboard in my local host and want to paste it ...
dj199008's user avatar
  • 1,769
73 votes
6 answers
123k views

Notepad++ How do I insert a column of data?

So I am trying to take a column of text data and replace that data with edited information. I am trying to manipulate values in a fixed width file. I want to leave the rows intact. I know I can hold ...
user2871554's user avatar
69 votes
16 answers
81k views

How to disable pasting in a TextField in Swift?

I've got a TextField with a numberPad and the function runs only if it contains numbers. The user will crash the app if they paste letters in the TextField and click OK. How can I disable pasting in ...
Eliko's user avatar
  • 881
68 votes
3 answers
94k views

How to paste a string on each element of a vector of strings using apply in R?

I have a vector of strings. d <- c("Mon","Tues","Wednes","Thurs","Fri","Satur","Sun") for which I want to paste the string "day" on each element of the vector in a way similar to this. week <-...
pedrosaurio's user avatar
  • 4,778
67 votes
2 answers
71k views

Is there a way to paste together the elements of a vector in R without using a loop?

Say there's a vector x: x <- c("a", " ", "b") and I want to quickly turn this into a single string "a b". Is there a way to do this without a loop? I know with a loop I could do this: y <- "" ...
Max's user avatar
  • 825
66 votes
14 answers
71k views

suppress NAs in paste()

Regarding the bounty Ben Bolker's paste2-solution produces a "" when the strings that are pasted contains NA's in the same position. Like this, > paste2(c("a","b", "c", NA), c("A","B", NA, NA)) [...
Eric Fail's user avatar
  • 8,429
63 votes
4 answers
69k views

Intercept paste event in Javascript

Is there a way to intercept the paste event in JavaScript and get the raw value, change it, and set the associated DOM element's value to be the modified value? For instance, I have a user trying to ...
Brandon's user avatar
  • 10.9k
59 votes
6 answers
55k views

Pass a vector of variables into lm() formula

I was trying to automate a piece of my code so that programming become less tedious. Basically I was trying to do a stepwise selection of variables using fastbw() in the rms package. I would like to ...
Anand's user avatar
  • 759
56 votes
2 answers
60k views

How to use reference variables by character string in a formula?

In the minimal example below, I am trying to use the values of a character string vars in a regression formula. However, I am only able to pass the string of variable names ("v2+v3+v4") to the formula,...
Eric Green's user avatar
  • 7,495
54 votes
9 answers
70k views

Equivalent of Paste R to Python

I am a new python afficionado. For R users, there is one function : paste that helps to concatenate two or more variables in a dataframe. It's very useful. For example Suppose that I have this ...
GjT's user avatar
  • 569
50 votes
3 answers
48k views

Paste multiple times in Vim

This maybe really simple, But I tried searching and I ended up with stuff like copying multiple lines, cut and paste multiple lines etc. What am looking for is pasting a single line multiple times in ...
Lakshmi Narayanan's user avatar
50 votes
3 answers
82k views

Difference between paste() and paste0()

Being new to R, can someone please explain the difference between paste() and paste0(), what I had understood from some post is that paste0("a", "b") === paste("a", "b", sep="") Even I tried ...
Andre_k's user avatar
  • 1,700
47 votes
4 answers
111k views

Concatenate rows of a data frame

I would like to take a data frame with characters and numbers, and concatenate all of the elements of the each row into a single string, which would be stored as a single element in a vector. As an ...
Sam's user avatar
  • 745
47 votes
4 answers
98k views

How to paste columns from separate files using bash?

Using the following data: $cat date1.csv Bob,2013-06-03T17:18:07 James,2013-06-03T17:18:07 Kevin,2013-06-03T17:18:07 $cat date2.csv 2012-12-02T18:30:31 2012-12-02T18:28:37 2013-06-01T12:16:05 ...
blehman's user avatar
  • 1,930
41 votes
1 answer
6k views

How windows handle the clipboard interface with Xming?

My question comes from a problem: I Use Xming on Windows 7 to connect to a Linux host (through PuTTY) in order to start and display a gnome-terminal. I have some troubles using the Windows clipboard: ...
Jonathan's user avatar
  • 804
40 votes
8 answers
52k views

How to paste to Emacs from clipboard on OSX?

This might be extraordinarily simple, but I am playing with Emacs (22.1.1) and I can't get it to paste text in the clipboard using Control-Y.
n_x_l's user avatar
  • 1,590
39 votes
3 answers
74k views

Concatenate row-wise across specific columns of dataframe

I have a data frame with columns that, when concatenated (row-wise) as a string, would allow me to partition the data frame into a desired form. > str(data) 'data.frame': 680420 obs. of 10 ...
Jubbles's user avatar
  • 4,530
39 votes
3 answers
111k views

Concatenate numerical values in a string

I would like to store this output in a string: > x=1:5 > cat("hi",x) hi 1 2 3 4 5 So I use paste, but I obtain this different result: > paste("hi",x) [1] "hi 1" "hi 2" "hi 3" "hi 4" "hi 5" ...
kahlo's user avatar
  • 2,344
39 votes
6 answers
71k views

Pasting from SQL Server Management Studio to Excel concatenates columns

I'm trying to paste my query results from Mgmt Studio to Excel, but for whatever reason the columns in Mgmt Studio are concatenated into a single column when pasted into Excel. This doesn't happen to ...
Great Kindness's user avatar
36 votes
2 answers
53k views

Paste/Collapse in R

I'm confused by paste, and thought it was just simple concatenating. whales <- c("C","D","C","D","D") quails <- c("D","D","D","D","D") results <-paste(whales, quails, collapse = '') Why ...
DSG's user avatar
  • 487
35 votes
6 answers
35k views

Looping over pairs of values in bash [duplicate]

I have 10 text files and I want to paste each file with its pair, such that I have 5 total files. I tried the following: for i in 4_1 5_1 6_1 7_1 8_1 do for j in 4_2 5_2 6_2 7_2 8_2 do paste ${i}....
Rish's user avatar
  • 826
35 votes
6 answers
48k views

jquery how to get the pasted content

I have a little trouble catching a pasted text into my input: <input type="text" id="myid" val="default"> $('#myid').on('paste',function(){ console.log($('#myid').val()); }); ...
greenbandit's user avatar
  • 2,265
35 votes
5 answers
22k views

How to paste CSV data to Windows Clipboard with C#

What I'm trying to accomplish My app generates some tabular data I want the user to be able to launch Excel and click "paste" to place the data as cells in Excel Windows accepts a format called "...
namenlos's user avatar
  • 5,131
34 votes
3 answers
16k views

How to paste on click? It works in google docs

I want to be able to initiate real paste event when user clicks. I can understand this may be a security issue, because if any webpage had access to users clipboard, that would be bad. So I thought ...
Tomas M's user avatar
  • 7,187
31 votes
10 answers
36k views

Clean Microsoft Word Pasted Text using JavaScript

I am using a 'contenteditable' <div/> and enabling PASTE. It is amazing the amount of markup code that gets pasted in from a clipboard copy from Microsoft Word. I am battling this, and have ...
OneNerd's user avatar
  • 6,522
29 votes
9 answers
9k views

Why is pasting a long one-liner very slow in Vim's insert mode?

My Macbook was stuck yesterday, when I tried to paste 1200 lines of 80 characters to Vim. It was much faster to download the file, and not to paste the text. I have thought that this problem might be ...
Léo Léopold Hertz 준영's user avatar
29 votes
7 answers
31k views

in R, can I stop print(cat("")) from returning NULL? and why does cat("foo") return foo>

If I enter print(cat("")) I get NULL I want to use cat() to print out the progress of an R script, but I don't understand why it is returning NULL at the end of all of my concatenated strings, ...
David LeBauer's user avatar
26 votes
5 answers
44k views

javascript cut/copy/paste to clipboard: how did Google solve it?

Yes, this question has been asked again and again: how to copy and paste from and to the system clipboard with javascript? I have found only partial solutions and hacks so far. The reason that it has ...
Jos de Jong's user avatar
  • 6,711
25 votes
4 answers
11k views

Can't paste all text in wpf textbox

I have a simple window and textbox, when i try to paste this code to the textbox [Code]General : sample.avi Format : AVI Length : 380 MiB for 16mn 57s 320ms Video #0 ...
Programista's user avatar
  • 1,046
25 votes
7 answers
21k views

Copy from browser paste to netbeans not working

Copy from browser paste to netbeans not working. How could this be happen? When I try to paste notepad, it is working, but when try to netbeans it is not working? I am in shock
devrim's user avatar
  • 337
25 votes
2 answers
45k views

Explanation for sprintf("%03d", 7) functionality?

I am trying to write functions in R where the aim is to read multiple .csv files. They are named as 001.csv, 002.csv, ... 332.csv. With paste I managed to construct names 1.csv, 2.csv and so on, but ...
user3592253's user avatar
25 votes
3 answers
25k views

Split a character vector into individual characters? (opposite of paste or stringr::str_c)

An incredibly basic question in R yet the solution isn't clear. How to split a vector of character into its individual characters, i.e. the opposite of paste(..., sep='') or stringr::str_c() ? ...
smci's user avatar
  • 33.3k
24 votes
5 answers
27k views

Paste a HTML table into Excel, how to keep the line break in cell

I have a simple html table, for example, just one cell, but when I copy the dom node, and paste it into excel, it will be recognize as two rows, How to make Excel get the correct paste data. <...
virsir's user avatar
  • 15.3k
23 votes
6 answers
59k views

How do you copy/paste from the clipboard in C++?

I'm still a C++ newbie who has only recently learned some file manipulation. I looked it up online and the codes given are way beyond my current skill. Is there a simple way to do this, or are there ...
user avatar
22 votes
5 answers
20k views

selecting in visual mode to paste outside vim window

I need to paste some selected block in visual mode to outside of vim. Currently I need to select this block manually from mouse to paste outside of vim. As selecting texts in visual mode is easier ,...
shampa's user avatar
  • 1,360
21 votes
3 answers
9k views

How to get Registry().settings during Pyramid app startup time?

I am used to develop web applications on Django and gunicorn. In case of Django, any application modules in a Django application can get deployment settings through django.conf.settings. The "...
takaomag's user avatar
  • 1,595
21 votes
2 answers
7k views

What is paste script?

I'm trying to understand what paste script and paster are. The website is far from clear. I used paster to generate pre-made layouts for projects, but I don't get the big picture. As far as I ...
Stefano Borini's user avatar
19 votes
5 answers
28k views

Pasting from the clipboard and automatically toggling ":set paste"

When I paste things from the clipboard, they're normally (always) multilined, and in those cases (and those cases only), I'd like :set paste to be triggered, since otherwise the tabbing will increase ...
Jonatan Littke's user avatar
19 votes
3 answers
11k views

Paste an image into a web page

Is it in any way possible, using javascript (jquery), html (5) to get a pasted image. e.a a user click the printscreen button, opens a web page, clicks CTRL+V and the image is uploaded to the server (...
Alexey's user avatar
  • 642
18 votes
4 answers
6k views

vimrc addition to toggle :set paste

I'm looking for a way to bind a key combination (something like leader+p) to toggle :set paste on and off with the same key combo. I know I can :set paste and :set paste! and can bind these to 2 ...
darryn.ten's user avatar
  • 6,873

1
2 3 4 5
52