Getting substrings from the content of a resource fork

Joined
Jan 4, 2016
Messages
1
Reaction score
0
Points
1
I'm getting access to the content of textClipping files with the following Shell command, that I use from within Automator:

DeRez -script Roman -only utf8 MyFile.textClipping

I get this type of output:

data 'utf8' (256) {
$"4120 6578 7065 7269 C3AA 6E63 6961 2064" /* A experiência d */
$"6520 4D69 6C6C 6572 2065 2055 7265 792C" /* e Miller e Urey, */
$"2071 7565 2074 656D 2076 696E 646F 2061" /* que tem vindo a */
$"2073 6572 2072 6561 6C69 7A61 6461 2068" /* ser realizada h */
$"C3A1 206A C3A1 206D 6169 7320 6465 2035" /* á já mais de 5 */
$"3020 616E 6F73 2C20 7365 6D70 7265 2063" /* 0 anos, sempre c */
$"6F6D 206D 6169 7320 7072 6563 6973 C3A3" /* om mais precisã */
$"6F20 6520 636F 6E64 69C3 A7C3 B565 7320" /* o e condições */
$"6D61 6973 2072 6566 696E 6164 6173 2C20" /* mais refinadas, */
$"6465 6D6F 6E73 7472 6120 7175 6520 6F20" /* demonstra que o */
$"7375 7267 696D 656E 746F 2064 6520 616D" /* surgimento de am */
$"696E 6FC3 A163 6964 6F73 2062 C3A1 7369" /* inoácidos bási */
$"636F 7320 286F 7320 626C 6F63 6F73 2062" /* cos (os blocos b */
$"C3A1 7369 636F 7320 6461 2076 6964 6129" /* ásicos da vida) */


I would like to get just the strings inbetween the /* and the */
I mean, just the:

A experiência d
e Miller e Urey,
que tem vindo a
ser realizada h
á já mais de 5
0 anos, sempre c
...

And concatenate all in a single string.
I tried it with:

DeRez -script Roman -only TEXT MyFile.textClipping | perl -ne 'm|/\* .* \*/| && print $1; END {print "\n"}'

But it is not working. :(
Could it be because I'm accessing the utf8 resource (because I need accentuation) and the string matching does not work with 2-byte characters?

Can someone help me?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top