Paste clipboard contents in Terminal? - Nexus One Q&A, Help & Troubleshooting

Is there any way to access the clipboard contents from a Terminal? I can't find any file where the copied text is stored, I suppose the phone may just store it in memory?
I had a workaround for this on my iPhone. The iPhone stored it in a file with a bunch of nonprinting characters so, rather than decipher that, I found a multi-clipbard app which stored the contents in plain text and I wrote a script to extract it from that file. I've looked for a similar app for Android and have found a couple, but they store the copied text in sqlite databases and I haven't had any luck getting it out.
So, is there any method to access the clipboard from a terminal, or any way to find it somewhere as plain text?

Ok, I spent some time downloading clipboard apps until I found one to use as a workaround. It's called Clipstore by benishouga and it stores the clipboard contents in a plain text file at /data/data/jp.benishouga.clipstore/files/clip.txt.
It is meant to keep a clipboard history of multiple items and it stores every entry on a single line. It replaces newlines with a "n" tag so even if you have 20 clipboard history items consisting of multiple lines, the most recent will always be on top and it will all be on a single line. So the paste command can simply be:
Code:
sed 's/<n>/\n/g;q' /data/data/jp.benishouga.clipstore/files/clip.txt
Example: I copied this text from a note app
Second test start
Blah blah
Second test end
It appears like this in /data/data/jp.benishouga.clipstore/files/clip.txt
Code:
Second test start<n>Blah blah<n>Second test end
In a terminal:
Code:
bash-4.1# cat /system/bin/clip
#! /system/bin/sh
sed 's/<n>/\n/g;q' /data/data/jp.benishouga.clipstore/files/clip.txt
bash-4.1# clip
Second test start
Blah blah
Second test end
bash-4.1#
Yay!

Related

Text Editor

Hi,
I need a text editor that can do the following things:
- I have 2 files, let's say file abc.txt and def.txt
cat abc.txt:
[HKEY_CURRENT_USER\ABC]
A=1
B=2
C=3
cat def.txt:
[HKEY_CURRENT_USER\ABC]
A=1
B=2
C=3
[HKEY_LOCAL_MACHINE\DEF]
D=4
E=5
F=6
- def.txt is superset of abc.txt
- I want to make the content of abc.txt as a base search for abc.txt and if there is a similar entries in file def.txt then it prompt and ask if I want to delete the entries in def.txt.
Basically I want to compare abc.txt and def.txt and delete the content inside def.txt that similar to file abc.txt.
I did a searching and so far found nothing on the text editor that can do what I want.
Cheers,
Vibranze
im not aware of anything that does this. The only thing I can suggest is to get a second notepad program so you can open two text files at once, and then do your searching and editing manually.
Hi Neptune,
Yeah, this is what I thought too, no such tools exist and I need to do eye balling
Cheers,
Vibranze
While talking to a friend about dealing with two text files he mentioned this program:
http://www.pdalive.com/seymour.php
Allows you to split your screen into two allowing you to view to applications at once. Maybe this will help speed up the aforementioned process of editing text files.
well the pocketVI which is free have a "c" "compiler" in it
maybe it could be used
might help
http://www.ultraedit.com/index.php?name=Content&pa=showpage&pid=34
I swear by UltraEdit (from the same people as UltraCompare), but I've never gotten on with UltraCompare....for comparing, merging and updating files and folders, I use "Beyond Compare (See HERE) from ScooterSoftware - it's not free, but it's a small price to pay (IMHO!!) for the features it offers....
See what you think...
Mark.
Thanks all for the reply.
Can the comparison software compare two files and show me the line containing same entries and options to delete the line from the superset file (def.txt)?
Or if I sort both files, then I paste content of abc.txt into def.txt and use text editor to search and highligh for duplicate entries within def.txt so I can delete it, is there any text editor that can search for duplication inside the file?
Appreciated the feedback given. Thanks.
Cheers,
Vibranze

Better Terminal Emulator Magic

Just showed up in the market. Awesome works the 1.5 soft keyboard. Has its quirks but does have some good uses, an update was put out this morning to fix the enter key problem.
great find! it's so hard to sort through the **** apps these days. can't wait until we get a well needed market update.
Just to let people know they have a message saying it doesn't work on some modified Roms. I'm on 6.0h and it didnt work for me. it went into a force close loop even when i wasnt using it.
Its a step in the right direction, but its not all there quite yet. VERY HELPFUL though
1) There is a problem getting the <enter> key working. I find that I need to roll around the scroll button a bit before the enter key will work after starting or switching users.
** another way to deal with this is to use a different shell. For some reason, using full bash instead of sh works. There are other (great) advantages to this (more on that later).
2) You can't see what you're typing when in landscape mode, which is the only way that the VK is actually practical -- keys are too small to use effectively in portrait.
3) If you use a colored shell, the colors screw up when switching to/from the vk. Must be something to do with how he's buffering and redrawing the console.
On using bash instead of sh...
Advantages:
1) color
2) BASH HISTORY
3) scroll wheel = arrow keys
4) lots more -- http://en.wikipedia.org/wiki/Bash
How:
copy bash into some executable part of the filesystem
create a bashrc file anywhere at all in the filesystem.
put in your bashrc the following:
Code:
PS1="[\w]\\$ "
HISTFILE=/some/path/file/with/write/permissions
** this is of course a regular shell script, so add whatever startup code you like in there, like a custom PATH, etc.
IN the "better terminal emulator" program, menu --> preferences --> command line and set it to "/path/to/bash --rcfile /path/to/bashrc"
And of course, running the following:
Code:
su -c "/path/to/bash --rcfile /path/to/bashrc"
will give you root with bash and the same setup as your regular user, including a shared history file (note that the history file is only updated when bash EXITS and so it is current as of the moment you initially LAUNCHED the terminal app.
Note: I like to write that su -c line into a wrapper I call "subash" that I place in the path.
bash is attached for convenience, its a .tar.gz file with an extra extension to confuse the newbs (and trick the forum filter into allowing it).
@lbcoder
Thanks Great tip!
@lbcoder
Thanks Great tip!
using bash as default shell
Id love to use bash, its the shell im used to and since Im not that good at *nix having bash would help, 1 cyanogen rom had ash(i think) and then none of the scripts floating around worked and so they needed to be edited(something that sounds a bit tedious)
Id also like a decent prompt, maybe color ls and all those bells and whistles, I think this could be well received with all the bugs worked out and maybe a script that would make any scripts found on the device into a format that bash needs...
the biggest is the lack of history, I have used a good variety of linux and unix shells and droids is the first without cmd history, a prompt with 'pwd' and tab auto complete...
cant we just get a REAL shell, is that so wrong?
bhang
Job Control
lbcoder said:
On using bash instead of sh...
Advantages:
1) color
2) BASH HISTORY
3) scroll wheel = arrow keys
4) lots more ...
Click to expand...
Click to collapse
Very nice and very useful. Thanks for providing this!
One feature lost in this build of bash: Job Control (^Z, jobs, fg, bg, and %number commands to manipulate jobs). Hitting Ctrl-Z suspends the bash shell and all its child processes.
The existing sh shell supports job control. This build of bash does not.
I'm going to have to learn how to set up a cross-compilation environment. Another project to add to the list...

local full text search?

I've been looking around for a while, but without much success. What I need is the following:
A small search app that can perform full text search over a folder of local files on the SD (txt, html, maybe others). It's important that it doesn't search online, or at least can be told to limit the search to local files.
Has anyone encountered something like that?
aFile does that. There's a free, and paid version. I'm pretty sure its available in the free one, I have the paid and it works in that. You can search the system folders too.
Hmm...maybe I'm just too dense, but I can't seem to get aFile to search within the files, just the file name. Also, I can't stop it from search online too.
I also tried Aurora, but the problems are the same.
Basically, what I need is a version of grep that is useable on the G1.
I too am looking for an app that can do a text search inside a folder containing several text files. Grep can do that on Linux, but it seems to need root access on the Rogers HTC Dream.
Request:
App that can Text search inside files in a specified folder on the SD card.

Something like 'grep' for Android?

I have a few hundred text files in a folder on my SD card, and I need some way of searching across them. For instance, if I search for 'balloon', it needs to returns the names of the files that contain the word 'balloon', not in the filename, but in the text.
Bonus points if it would allow for wildcards, or allow me to open the result files in an editor or viewer.
Does anyone know of something like this? It's basically a frontend to 'grep' along with a simple GUI.
EDIT: Oh, and before someone mentions it...Aurora does NOT do this. It can search the filenames, but not within the text files.
An up from a dusty cupboard
Very old thread, up !
I'm looking for a command in Android shell, to do the same job as "grep" for Linux/UNIX ?
Someone got an alternative ?
Thanks

Notes and Highlights

Does anyone know where the notes and highlights are stored, when you add them to a book?
Alternatively, is there a grep-like function that I can use when connecting via adb shell?
Thanks...
John
Bump. Good ?
notes and highlites are stored, I'm pretty sure, in data/data/ then in the folder of the app you used, IE:
com.amazon.kindle
com.bn.nook.reader
com.kobobooks.bordersus.android
In each of those folders are Database, Files, and Shared_Prefs folders, each containing varios xml files that appear to hold all that information...
- Will.
Still poking around in the Data and System folders....
john_es said:
Does anyone know where the notes and highlights are stored, when you add them to a book?
Alternatively, is there a grep-like function that I can use when connecting via adb shell?
Thanks...
John
Click to expand...
Click to collapse
You mean how to access them in the reader or where are they stored in root,?
WillCameron said:
notes and highlites are stored, I'm pretty sure, in data/data/ then in the folder of the app you used, IE:
com.amazon.kindle
com.bn.nook.reader
com.kobobooks.bordersus.android
In each of those folders are Database, Files, and Shared_Prefs folders, each containing varios xml files that appear to hold all that information...
- Will.
Still poking around in the Data and System folders....
Click to expand...
Click to collapse
You were right - they are stored in sqlite databases in those folders
This is an old thread but I had the same question and did a little digging.
I went to data/data/com.nook.reader.activities/databases/
and found a database file called annotations.db
I opened it and found:
android_metadata
annotations
sqlite_sequence
I'm an Android newbie but I opened the file with sqlitebrowser_200_b1_win and exported the annotations part of the table to a csv file which I could view in Excel.
Now clearly nobody will put this much effort into findings some highlights from a book but wouldn't this be a good opportunity for someone to put together an app to allow exportation of notes and highlights? The B&N boards are crawling with academic types like me complaining about the lack of this feature.

Categories

Resources