I've done a bit of clipboard transformation scripting using xclip before, piping contents with " xclip -o -selection clipboard " to grep, sed, awk, then back into the clipboard with " xclip -i -selection clipboard " ... but I am not a fantastically skilled user of either of the three commands, more of a hack. I'm stumped on this one.
Most of my usage requires scraping clipboard contents and reformatting data for pasting quickly without an intermediary step (such as scraping 3500 lines of html and parsing out 95 links to put into a trouble ticket). This is no different, though it's much less data and just needs to be sorted out to one line for frequent, repetitive pasting.
I have a chunk of text that looks like this:
The customer could be any combination of numbers, letters, spaces and symbols of any length, but will always be followed by a hyphen (used in the output) The 5digit number is of no consequence. The Client can be any combination as well, but never contains spaces.
I need to copy one chunk of that, and return a single line that looks like this for pasting:
I would love to do it with xclip / sed (as I'm REALLY green with awk) but whatever gets the job done is what I'll use, and work to understand why it functions properly.
That was astoundingly fast and unexpectedly clean, thank you! With all the swapping in and out of hold space though, I'm not sure how to put the brackets around the pattern at the end so it looks as follows:
Idea? I did study the sed arguments you used, very nice!
That was astoundingly fast and unexpectedly clean, thank you! With all the swapping in and out of hold space though, I'm not sure how to put the brackets around the pattern at the end so it looks as follows:
Idea? I did study the sed arguments you used, very nice!
Woops. Forgot that bit. I just edited the post. Try it now.
Well, that just saved me a whole lot of clicking every night. I think I'll enjoy learning and sharing here.
Here's a cool little grep / sed bit I wrote (with help) to scrape from a massive block of code just exactly the custom linked information I need to paste - it's very efficient and probably easily portable to any source scraping / aggregating usage.
A bit pedestrian perhaps, but lots of useful things get around on two legs.
I do have an input text file of the following format with 1000's of lines
input file:
3386(11:11,Ani:0,Bri:1,ch:1,Jwe:0,Jor:0,LP:0,Lo:0,NS:1,al:1,bo:0,boy:0,bru:0,sh:0,cor:1,dum:0,ery:0,mac:0,mic:0)... (3 Replies)
Hello Experts,
I need to transform rows into column using awk. I tried few things but failed to obtain desired output, as I'm fairly new to awk.
i/p file
100, READ, 12
100, WRITE, 8
100, SEEK, 1
142, READ, 2
142, WRITE, 34
142, SEEK, 3
O/p Needed
PROC_ID 100 142
READ 12 ... (2 Replies)
Hi all, I have to transform a XML file like this:
<?xml version="1.0"?>
<vocabulary>
<voc_id>102</voc_id>
<name>Vocabulary Name</name>
<description>Voc description</description>
<relations>3</relations>
<hierarchy>5</hierarchy>
<word>
<word_id>1</word_id>
... (1 Reply)
Hi
I have one input xml file
<param name="EXTR_COL" valueDesc="AUTHD_RFLL" value="rx.AUTHD_RFLL" />
There is a mapping parameters in Database.
if EXTR_COL is present in input XML then it is mapped to fieldlist.
so the o/p XML looks like
<fieldlist>
<datasource... (1 Reply)
Hi ..
I have one input XML and I want to convert into another XML using parameter mapping through Database through Unix shell script. But I dont have idea how to do that.
And how can I create xsl sheet if mapping is through database tables.
Please help me on this. (1 Reply)
Hi,
I want to write a perl script. Which should accept the xml file, one xsl file and the loaction. The perl script should process the xml file using the xsl file and puts the out put in specified location.
For example:
My.perl is perls cript.
my.xml
is like this
<?xml version="1.0"... (2 Replies)
I've got a multitude of text data files that carry exactly the same kind of data. Unfortunately some of them have a different filename format
some are: 'category'_'month'-'year'_act.txt
an example being: daf_Apr-1961_act.txt
and some are: 'category'_ 'year'-'month'_act.txt
an... (16 Replies)
Hey,
Has anyone else ever run into a problem with Reflection X and clipboard not working? I'll copy something command line, try to vi into a file and paste it and it either pastes nothing or sometimes the correct data and even in some cases it will print stuff in the clipboard from 3 copies ago.... (2 Replies)
:confused:
Hye everybody i would like to know if exist a internet site where i can founs some interesting shell script very usefull
I need to transform hundreds names of files escribed in CAPITAL letter in minuscule letter
do oyu know a mean o do that that thanks to a script or a shell... (1 Reply)