-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQuoted-list.ini
32 lines (32 loc) · 1.05 KB
/
Quoted-list.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# From https://gist.github.com/DavidPx/fbf8c55009c09621084b267d8c325c70
# These are CopyQ commands I use for copying data out of spreadsheets and into SQL windows.
# single-quoted-list.ini (Quoted-list-single.ini) is good for creating an in clause from a single column of values.
# values-grid.ini (Quoted-list.ini) is good for creating the values section of an insert statement.
# Installing these is quite easy:
#
# 1. Copy the script
# 2. Within Copyq hit F6 to bring up the Command editor
# 3. Now click the Paste Commands button
#
# Script modified to:
# 1. Clean empty strings
# 2. Use clipboard instead of selection
[Command]
Command="
copyq:
// var text = str(data(mimeText)); // take selection
var text = str(clipboard()) // Take clipboard
var updated = text
.split(/[\r\n]+/)
// split line content by tab
.map(line => '('+ line.split('\\t').map(x => `'${x}'`).join(',') + ')')
.join(',\\n');
copy(mimeText, updated);
paste();
"
HideWindow=true
Icon=\xf00a
InMenu=true
Input=text/plain
Match=\\t
Name=&Values List