como encontrar uma string e depois pegar só uma parte dela usando o terminal? [RESOLVIDO]

13. Re: como encontrar uma string e depois pegar só uma parte dela usando o terminal? [RESOLVIDO]

Vinicius Bastos
vini122

(usa Outra)

Enviado em 17/07/2016 - 10:04h

msoliver escreveu:

vini122 escreveu:

msoliver escreveu:

vini122 escreveu:


Tenho um arquivo que contem várias Strings

Mas quero pesquisar essa:
<string name="gshdhhdd+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q=">JBrASyhJ41pYZtdc6o0lTA==:ule0oL3h2BlbqhC8TlhdepvfMKkilDnLWxkx3nrIs8o=:ULf0S4v7X+4hvaf2X4qsuJGq0aUlQU1S2K9fTiWbeC0=</string> 

Mas oque eu quero somente é esse código:
JBrASyhJ41pYZtdc6o0lTA==:ule0oL3h2BlbqhC8TlhdepvfMKkilDnLWxkx3nrIs8o=:ULf0S4v7X+4hvaf2X4qsuJGq0aUlQU1S2K9fTiWbeC0= 

Oque está entre esse
<string name="gshdhhdd+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q="> 

e esse
</string> 

E depois salvar em um arquivo
como posso fazer isso usando o terminal?

____________________________________________________
Boa noite, vini122.
Note que usei 1ª parte entre aspas duplas(incluindo-as) para fazer a busca.
É necessário escapar os sinais de "+", são metacaracteres.
egrep --color '"gshdhhdd\+vF1KfnYnlHbk\+LFk5Y\+HqaZXbEjc9Q="' Arquivo_Strings.txt |egrep -o '>.*<'|sed 's/^.\|.$//g' > STRING.txt 

O 1º egrep, busca.
O 2º egrep, "casa" o que esta entre ">" e "<"
O sed, exclui o 1º e o ultimo caractere, respectivamente, ">" e "<".

É isso!
E não esqueça, se a resposta foi útil, marque-a como A MELHOR!

att.:
Marcelo Oliver


Consegui
Apaguei somente
--color 


ficando assim
egrep '"gshdhhdd\+vF1KfnYnlHbk\+LFk5Y\+HqaZXbEjc9Q="' /sdcard/11.txt l |egrep -o '>.*<'|sed 's/^.\|.$//g'|sed "s/<//g" 


mas o resultado ficou assim com "<" no final
JBrASyhJ41pYZtdc6o0lTA==:ule0oL3h2BlbqhC8TlhdepvfMKkilDnLWxkx3nrIs8o=:ULf0S4v7X+4hvaf2X4qsuJGq0aUlQU1S2K9fTiWbeC0=< 


resolvi isso usando
|sed "s/<//g" 


poderia simplificar mas o código?
Ah, não Estou conseguindo adicionar o resultado na variável.
tentei isso
test1=`egrep '"gshdhhdd\+vF1KfnYnlHbk\+LFk5Y\+HqaZXbEjc9Q="' /sdcard/11.txt |egrep -o '>.*<'|sed 's/^.\|.$//g'|sed "s/<//g"` 

mas não. deu certo.
Desde ja agradeço.


vini122 escreveu:

msoliver escreveu:

vini122 escreveu:


Tenho um arquivo que contem várias Strings

Mas quero pesquisar essa:
<string name="gshdhhdd+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q=">JBrASyhJ41pYZtdc6o0lTA==:ule0oL3h2BlbqhC8TlhdepvfMKkilDnLWxkx3nrIs8o=:ULf0S4v7X+4hvaf2X4qsuJGq0aUlQU1S2K9fTiWbeC0=</string> 

Mas oque eu quero somente é esse código:
JBrASyhJ41pYZtdc6o0lTA==:ule0oL3h2BlbqhC8TlhdepvfMKkilDnLWxkx3nrIs8o=:ULf0S4v7X+4hvaf2X4qsuJGq0aUlQU1S2K9fTiWbeC0= 

Oque está entre esse
<string name="gshdhhdd+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q="> 

e esse
</string> 

E depois salvar em um arquivo
como posso fazer isso usando o terminal?

____________________________________________________
Boa noite, vini122.
Note que usei 1ª parte entre aspas duplas(incluindo-as) para fazer a busca.
É necessário escapar os sinais de "+", são metacaracteres.
egrep --color '"gshdhhdd\+vF1KfnYnlHbk\+LFk5Y\+HqaZXbEjc9Q="' Arquivo_Strings.txt |egrep -o '>.*<'|sed 's/^.\|.$//g' > STRING.txt 

O 1º egrep, busca.
O 2º egrep, "casa" o que esta entre ">" e "<"
O sed, exclui o 1º e o ultimo caractere, respectivamente, ">" e "<".

É isso!
E não esqueça, se a resposta foi útil, marque-a como A MELHOR!

att.:
Marcelo Oliver


Consegui
Apaguei somente
--color 


ficando assim
egrep '"gshdhhdd\+vF1KfnYnlHbk\+LFk5Y\+HqaZXbEjc9Q="' /sdcard/11.txt l |egrep -o '>.*<'|sed 's/^.\|.$//g'|sed "s/<//g" 


mas o resultado ficou assim com "<" no final
JBrASyhJ41pYZtdc6o0lTA==:ule0oL3h2BlbqhC8TlhdepvfMKkilDnLWxkx3nrIs8o=:ULf0S4v7X+4hvaf2X4qsuJGq0aUlQU1S2K9fTiWbeC0=< 


resolvi isso usando
|sed "s/<//g" 


poderia simplificar mas o código?
Ah, não Estou conseguindo adicionar o resultado na variável.
tentei isso
test1=`egrep '"gshdhhdd\+vF1KfnYnlHbk\+LFk5Y\+HqaZXbEjc9Q="' /sdcard/11.txt |egrep -o '>.*<'|sed 's/^.\|.$//g'|sed "s/<//g"` 

mas não. deu certo.
Desde ja agradeço.



Bom dia, Vini.
Na minha linha de comando
Já elimino o > e o < do inicio e fim da string pretendida.... com o comando sed 's/^.\|.$//g'
Alguma particularidade no seu arquivo.
Poste uma amostra do seu arquivo /sdcard/11.txt .

att
marcelo oliver


como estou fazendo testes deixei só isso
<string name="gshdhhdd+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q=">JBrASyhJ41pYZtdc6o0lTA==:ule0oL3h2BlbqhC8TlhdepvfMKkilDnLWxkx3nrIs8o=:ULf0S4v7X+4hvaf2X4qsuJGq0aUlQU1S2K9fTiWbeC0=</string> 


Mas oque realmente tem é
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="7i2BCGuwFtKXGn3Pi9IHoCwGRTIF0IiDekNySbbTr5A=">yLHG5RXLEqtkWF2NXik2ag==:a0mwksKpyDDHmDjcAA5GQ6tE0Yc7r8zYSodBJIV983o=:YLt24TF2QRlJTvZDXvsWmQ==</string>
<string name="UVVa8jXcus8ebMs5zn+XvkmZx37ktdkWQdsLcCDZIB4=">PD2n7WwPwcOiRWqG8kZoww==:5J+Gs/5fu49QOs+9ai0/94VRK/aZiNF8aNITo9KM/8s=:7JyUZmqry3/ALUNTmaGKNA==</string>
<string name="YnzwPd+CWs1WJgPCwzh5MLMz0Eihd8ujxzNgEsJcGjE=">6ZBv+tLrW/2bJZZRC1sl0w==:WX5LXpaUlY7PjLwF9NKDx5Icwl41QqVARCkvbK9IwIE=:zv1YJxj9YteOT/LTlVwqxA==</string>
<string name="/bfNm+HCmVQ8avIbU6alDSnrJjt6NcJkIRjOWYQJF1A=">mUWfZoV8/r+O/ZJtAt6mFA==:tMFqUwqIUEMO3Lt5lThRkDU2p+pYDHUQ+0E8FSm02K0=:WiBCixARA6TrJ3h7rEVK1Q==</string>
<string name="appLanguage">default</string>
<string name="sFULQ06JMvuYJmjW0AK3Xm75iOTnQwvr93D8TLfBo30=">eLLwqd0+Ohu+E/XggAzOjQ==:RKSSYazr9QoJNT1mEMUayCABds72ZQ9aaTakpF4Ysdk=:Sf2e6iDLXZMU0eJ7LHQiYg==</string>
<string name="zA3lC31FSfNG+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q=">tCfG0jRRLFulyr2sICTYMg==:kWyZRkcfSlHy2l5VHy23gWIsHqzWlhJK5xRK/AptQXw=:vGkm0A/OWn3DBg6jUw7ic7vj4OvuOUEOC7Vjyzuu0Lo=</string>
<string name="CLNmMhVh/KvWP3pqDLaGIpeU3EG4e+4GiuKf08q+Ha8=">g5sWp8sZMRAZmh0tp6XA7Q==:GFLFXBgCuAKvsMPz23peOv+uWURLif6Q3MOShxZPb9k=:0GDGfjJGLvPU9/6fqC7KpA==</string>
<string name="3ot50Q1aEIqm3s703t3SWwebYPpXLJkVKbDuCF2/s7c=">MIWeGX/W1tHka7yUCiBCCQ==:yJ+9N3eZ9jU40YyfK2FOy8f6yvoyNqQgUpS7t5sLm50=:0wMqCv6VYfV+PaG487TLKw==</string>
<string name="DsIUeOEaty+39wcupYKcO+R+39J1CuEqPMQ7ZF17V7c=">Hi0l/68Bo9T5kv0nLRZn5A==:Y3EnOYy1jmpUzR2CAd4exsD8q37vqGGftoKYvwCPZdo=:ju/r2ii/DaJjClyJhDIdSA==</string>
<string name="I59Z7VXnN8dxR89VrQwbAwttfudIp0JpUvm4UtWpNeU=">njOJDOp3auW7gqN+k/lVjA==:7P2CnH1dv+XhFHOKsjb5Rp80yGmSPEdwKuhQtzyHgKw=:UbUPFF2dFIuabgQzuy+qFJtQVudCrRn9FTU82F1pWabksnjfbWI63b20l1RME29QxgkBO6NqjnhcXSsNHt+VUiKsT0rd5ny56wUtKuBsoabW37jZ54ga3q8C9wtRxftmb3rNfO+OCs0ksQt6dhFLL/85RDWqKmmhQ9Y3JQlLEQZBMV5KI0g1f3z9ah5YWu5E</string>
<string name="vzu4uLvxAwLFTXnSIkIvuOyF25Yo759KAn2zyXnBYqc=">5MKEjpuVHYUkZXrFbkzGmQ==:IhU+iUENyhXamkO6BEOaUlNWj9FIvAZh+Bks5iDx3io=:R7ysEbn89VX6DKUrbQ2kEg==</string>
<boolean name="appsFilterDisplay" value="false" />
<string name="EPK2V/UoGHH+ezpru4RON9TOM7tlENNPmrt6QQT5AWc=">y01jbbi0jHlF0aUEBuUfaA==:pLynS3EITkNs3RQxTIDwH1AATwmSEumsMLT/Q8DkEGA=:DNhOP5vrwXQfT5ieMmFNlg==</string>
<string name="E8uKK7KQWhbK5A3rEud0ZOG3UR7VAJNaA6SR1VnVRl8=">tCWIUMvqSRnWqfTkCJP7VQ==:H7N5gEExbM6bm898IkQ7QuiLT9+H1nlNDgb2IM2Zmlw=:KaSMGQ/7ccSJ93C0zaOM3Q==</string>
<boolean name="3.1.0" value="true" />
<string name="BPiZbadjt6lpsQKO4wB1aerzpjVIbdqyEdUSyFud+Ps=">00cQtkbhuWzZJIfDBrZHiQ==:thZQuHfdB5zSU9Ii5pPqPji3BJpb+XzQFlPYByI5DDs=:LfvxVYDzaFy1AUgAyMr3SA==</string>
<string name="R0CuY0ewFywBJU/1W65a/1GZ9ERuf21kPUAYWz9HUUU=">tnh2M+00ltF0Ed6Mp0tmCw==:KE5CMjuFty7CkJsnBaGthju3GJyhhH7LQR1fmV2uB/8=:/wrxpxDTC/zZnlVaxDoJ+w==</string>
<string name="XohImNooBHFR0OVvjcYpJ3NgPQ1qq73WKhHvch0VQtg=">E3EyYxr6Wd1Ativwm1EQ7g==:12L3R+y2wP1vX3RqLZbBuCM+mO1Hw+yuctD1vVTljkk=:6pu9mCxT5EJbVviq/Meyrg==</string>
<string name="h4F1ZIDmCuClfi/fp1b69+nzyHj8u1GfU22QZLQ0N2k=">5QXKnLmaFEigtsvhiMN9QQ==:2ELMC/oEy6easZYgbond9R7uV2AJEldyilP7lJE8YBs=:2wCAjSA/8vif/kvPS9OMWA==</string>
<string name="gc5QzCO+iqaVH4KIC5Q+zn2YrvdlWZKA47GuemrLIuQ=">30YcKf/lFBRXHIPQ4GJd6Q==:VkDjkmkqzhJNhfBX8fbGQq/Cxm73hmH+iOuiGowkkWY=:1S1fG9e6WRm3XKXLV52Ryw==</string>
<string name="XTbx5K9+lVEVEn5ufSf5wkwtgM/nJiP8y4JlT/shi9Q=">Nqugx/co3n/lSxfiLpzC/g==:gplxdpFSfI1GNVYJ2pinZTif7w/qJgRTwgKWZlCA6MY=:ayGecKNk/vOwJi7IvoQdyNm1QqzFH4nWiZ8sOaEVinlOJyWobkGM5YqdTU1Y8M3MtyVEPs6jNX/J0CCFpLy1G6V5HUWjWFXod7Wr4RcuUXPspTjV9K9EijrpBCpglD8pLwBr+L9FBIcCyUQOQ0jnJpQuy36juP4HiCzfxR/hFC8QLts0a1WIrAz/6gNrJhKdPQAz6i3TM1R4eJIgE20NAh1cW81S1BtwNtZKZK4TsOr3rngIzaNOpUcga3y6tGg6BnjlYBCpJ24A4Fl4Ex9dutoLXsRGS/qkATi1AU+vNKsDrlqgfpJ+siIgCYRpOPgpPHWA5SIsQgsXqKVF/zUqMCPV/MlmR9jCa69iEqPMIzAy6+B5YzZuopH/8Rlk2Pil6APw4edAoy5M23EuONkmpQIDPeQMbWMKy1XFwn1d6lTZVoRzpcl+t0nRiyXLVH2m</string>
<string name="YxN5Lb6ydaBObc23WXkXvNnNyXtl2wOpLkcFOQItVi4=">okp126pMe1I3sRlD2+9rog==:gWv9HXoksoBoJpPiDS0Pd9GOpuqlEi7o400prmJMcx0=:q+wD8DZenCeOcVOMmlL7RA==</string>
<string name="6Jfq5qkgYV0C1EgZ+/fWVlW5VizHrevsGhf92EEXXrc=">XJoIJ+SRrxBlZFXcBmZ+nw==:vE1wWFp43PQSxLLkcPxAqW15vjTienN8pTGHFLIfgYA=:p3gAKuz0FXWBbLeI9eL/0w==</string>
<string name="1zngsr9kzOaLUz+thIhGT3OSfBUAfoPbUWIACR6XS2Q="></string>
<string name="/eqiCERiLL4s0q6sxLFxqqDo1li9uRDWOT4MIwbbD5M=">wZqX+UZqpEEuZFi56qPkaw==:8A5/RPuyFfduopDdWxDFWs7dO9xTMe28o27yDgIKVdM=:uI0bUtp8Uax2SX1At3HPlA==</string>
<string name="dMTQeqa04zK5IM7DkoENbK2NWoCu7sumPDNbDPD7sTU="></string>
<string name="PugTG2UhPOxHfvlA6OJJJ4xZFi90ksIB5ZKe6cbxSjM=">37im7iCov2GKId2aiXNvuQ==:SSL4xUbCdHQvl8/FW7kg7l7ddG7oU/Y0WlxQSvN9Qgc=:VS06ch2pZxZp7usdzz87rE/VnvVHb8FjUrfgd7QbjadSPskjfDWkS0zSrnRUgcwx9DDEF2RooYiwnQ0zWgkcO+kz+GyMlOL2t/RkowZ3Ec/LGV5OsnPiyHtrkCnuFDe2</string>
<string name="+NOXoz/LlyXbllAeZTvzz6RFXFY5SCuZNsIrIhY01lk=">/iTrMrxFHJdx8zf33/66Tg==:JSHXkxyI4cOQAZGeGZOxuQoq8gnBs/OWZhZJXvphwjo=:yfkqpoaU2Hakpgqy7ib9yg==</string>
<string name="uzXoGDroWz9wunSwtIud70SSrPQpVOE7REM34OO/680=">PMrT6nt0wymPWgp2kx1S3A==:GRsYX6KdFvV1tcCe7Loh2qz+mF2RDbPNAlU8UOylnbk=:HgRsOReTm4M3Vf2zndDaBw==</string>
<string name="uk3+jLW/V9ON/OMehPpwZqb0FKkK9eri6o7fz14DBEc=">ums3F1JCyOD3LiEqRnmVjg==:ro3rHWrN8sydFznp2ME18yQ3bnE7+hbAu8CaAc1AlUg=:gedX96sUDheUvTGmpKocJw==</string>
<string name="v5a6Kj3Ej2hP8a6m6Jdww7BXXIKTvAIEQfhyvZrk7RA=">MLpUvfuoobQ18z5Xl74UlQ==:I9qhAgLxrsYrQR2SUiKnqF9a2R+ZuDEl584RamMsLMs=:Mxr5pR0oTK9zDsvq3lHLhA==</string>
<string name="AUqiKvudHqksgc1I2y4+BLZ/ka04M+eNppjM4qAxKzc=">0tiTcOJ0Q+uviZRY9s+BFw==:deN3ymwXldTH+APXQyRu4n8SQ8iBgE3Mll1kH8FAe4g=:l0hoI4Knui4IXlcsQ0oRng==</string>
<string name="hUZYJT/SS9Z2PUGmcaZdOv2nj/MQT3ZsJeQbAyQDtTM=">IZASwkGVflKt8OvYEiGaCA==:cuJUq6fhwA/IviP9MG/N8jgDEK4nEJZh7zFGRpiBhfk=:wc0gV2ff/wswGFwQCb7ecw==</string>
<string name="h6KAJbDoHr40EjjPr6CewZlE4kOUfEhXMlGedIJ65JQ="></string>
<string name="5lMezPzNhHdLaQJYFhdFIaNe16aQn2GfG1LU2ZXtetQ=">2ykJeDEwkC5GTI1AKNQ0FQ==:JMeI0uecY/hROC/2CMghjMcRf+y33Vp9hXv9i6EVHbU=:vuFxOljVoFH1TuS+1xOWFA==</string>
<string name="ymhZgfHALbx7Ot753Vn91Zdcurc60srl9LWGHfR/RE4=">gHtb/R6CEo9/qGigYrlhJA==:YVfwQpV1kT/zVhdzLqa8A5nXDWC3xxnDHc42gkaLb9U=:xKmjPdRg4Ri+PiDdCdJPmrNCHt8Ka5KBtdf+hkEF0ZigiSB0SuAJk7zbNJ5zVVSkhYdAh7GsQCrahawXAkCsh0sh5fVJCypZDGBd3lmRsZQsIPes26miXkiXczM8MAtmYQqciMdjfMssqGvD1i6ERSk8tdCt3o+ovPCYtxjnpTq5sx8I0VTOdbLNalpSMr2tLYBVlX0mcSdIY3+SrMtdKnaWuOU49b8VqD17o2ioIdIQZto4bv2HRtFeITnQMhBAL+udwn0Lz1qWojITO/1sJiWhNvhymGeHaKh82T5hZ5/q25e7C1fn6hzzxrFBDKafWdMBvLNSCpXkCuhNeTFYIv8u+GZ6PEEnreQSZUn3jz/RzYSJ4+wYWu/dELYLGu7D2jTo8SVW40LmCduZYDdQZyJJuYRduAIWASHn2SeNLnBd+v156kEGiJMDsGqR+Iwf</string>
<string name="notifications_ringtone">content://settings/system/notification_sound</string>
<string name="s8+lbYQ7fOAPQCA9IjWUzHPp8iPGct5WOOhJBtzs5PY=">+XKzuOGRpqg/Ikub7KkSDA==:tLMIqQeCTwymiDOHJxr/g3CSIsNWpGfpGabWRFJV4Ak=:zw+UmkyqRTEbII+4Lk0cH9CNo+CeGDbeYgus5AQaKlXcOC9E/3YFMDbXEUIQaNCY</string>
<string name="Jk4vjrwms+DS4H7h+caX0aJbJMl5RVMPv/ADi0q3Ecg=">P1WRj74m52QRG1OhoKTQQg==:tDn45aS1j6yTTeqzS+EN4eHv5+ZOMVyBMwk7raUto4A=:FqYqA8JIpFDsgcieYZ49iA==</string>
</map>


poiser é isso se puder explique a variavel que pedi.


  


14. Re: como encontrar uma string e depois pegar só uma parte dela usando o terminal?

Jeffersson Abreu
ctw6av

(usa Nenhuma)

Enviado em 17/07/2016 - 12:56h

Isso parece ser realmente hard mas não é, sem frufrusinhos fica assim:
cat arquivo.txt | sed 's/name="//1;s/=">/ /;s/=:.*//' | egrep ' <' > saida.txt 

Falta alguns retoques finos mas ai já está quase pronto, teste e veja se é isso.

Saida é:
    <string 7i2BCGuwFtKXGn3Pi9IHoCwGRTIF0IiDekNySbbTr5A yLHG5RXLEqtkWF2NXik2ag=
<string UVVa8jXcus8ebMs5zn+XvkmZx37ktdkWQdsLcCDZIB4 PD2n7WwPwcOiRWqG8kZoww=
<string YnzwPd+CWs1WJgPCwzh5MLMz0Eihd8ujxzNgEsJcGjE 6ZBv+tLrW/2bJZZRC1sl0w=
<string /bfNm+HCmVQ8avIbU6alDSnrJjt6NcJkIRjOWYQJF1A mUWfZoV8/r+O/ZJtAt6mFA=
<string appLanguage">default</string>
<string sFULQ06JMvuYJmjW0AK3Xm75iOTnQwvr93D8TLfBo30 eLLwqd0+Ohu+E/XggAzOjQ=
<string zA3lC31FSfNG+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q tCfG0jRRLFulyr2sICTYMg=
<string CLNmMhVh/KvWP3pqDLaGIpeU3EG4e+4GiuKf08q+Ha8 g5sWp8sZMRAZmh0tp6XA7Q=
<string 3ot50Q1aEIqm3s703t3SWwebYPpXLJkVKbDuCF2/s7c MIWeGX/W1tHka7yUCiBCCQ=
<string DsIUeOEaty+39wcupYKcO+R+39J1CuEqPMQ7ZF17V7c Hi0l/68Bo9T5kv0nLRZn5A=
<string I59Z7VXnN8dxR89VrQwbAwttfudIp0JpUvm4UtWpNeU njOJDOp3auW7gqN+k/lVjA=
<string vzu4uLvxAwLFTXnSIkIvuOyF25Yo759KAn2zyXnBYqc 5MKEjpuVHYUkZXrFbkzGmQ=
<boolean appsFilterDisplay" value="false" />
<string EPK2V/UoGHH+ezpru4RON9TOM7tlENNPmrt6QQT5AWc y01jbbi0jHlF0aUEBuUfaA=
<string E8uKK7KQWhbK5A3rEud0ZOG3UR7VAJNaA6SR1VnVRl8 tCWIUMvqSRnWqfTkCJP7VQ=
<boolean 3.1.0" value="true" />
<string BPiZbadjt6lpsQKO4wB1aerzpjVIbdqyEdUSyFud+Ps 00cQtkbhuWzZJIfDBrZHiQ=
<string R0CuY0ewFywBJU/1W65a/1GZ9ERuf21kPUAYWz9HUUU tnh2M+00ltF0Ed6Mp0tmCw=
<string XohImNooBHFR0OVvjcYpJ3NgPQ1qq73WKhHvch0VQtg E3EyYxr6Wd1Ativwm1EQ7g=
<string h4F1ZIDmCuClfi/fp1b69+nzyHj8u1GfU22QZLQ0N2k 5QXKnLmaFEigtsvhiMN9QQ=
<string gc5QzCO+iqaVH4KIC5Q+zn2YrvdlWZKA47GuemrLIuQ 30YcKf/lFBRXHIPQ4GJd6Q=
<string XTbx5K9+lVEVEn5ufSf5wkwtgM/nJiP8y4JlT/shi9Q Nqugx/co3n/lSxfiLpzC/g=
<string YxN5Lb6ydaBObc23WXkXvNnNyXtl2wOpLkcFOQItVi4 okp126pMe1I3sRlD2+9rog=
<string 6Jfq5qkgYV0C1EgZ+/fWVlW5VizHrevsGhf92EEXXrc XJoIJ+SRrxBlZFXcBmZ+nw=
<string 1zngsr9kzOaLUz+thIhGT3OSfBUAfoPbUWIACR6XS2Q </string>
<string /eqiCERiLL4s0q6sxLFxqqDo1li9uRDWOT4MIwbbD5M wZqX+UZqpEEuZFi56qPkaw=
<string dMTQeqa04zK5IM7DkoENbK2NWoCu7sumPDNbDPD7sTU </string>
<string PugTG2UhPOxHfvlA6OJJJ4xZFi90ksIB5ZKe6cbxSjM 37im7iCov2GKId2aiXNvuQ=
<string +NOXoz/LlyXbllAeZTvzz6RFXFY5SCuZNsIrIhY01lk /iTrMrxFHJdx8zf33/66Tg=
<string uzXoGDroWz9wunSwtIud70SSrPQpVOE7REM34OO/680 PMrT6nt0wymPWgp2kx1S3A=
<string uk3+jLW/V9ON/OMehPpwZqb0FKkK9eri6o7fz14DBEc ums3F1JCyOD3LiEqRnmVjg=
<string v5a6Kj3Ej2hP8a6m6Jdww7BXXIKTvAIEQfhyvZrk7RA MLpUvfuoobQ18z5Xl74UlQ=
<string AUqiKvudHqksgc1I2y4+BLZ/ka04M+eNppjM4qAxKzc 0tiTcOJ0Q+uviZRY9s+BFw=
<string hUZYJT/SS9Z2PUGmcaZdOv2nj/MQT3ZsJeQbAyQDtTM IZASwkGVflKt8OvYEiGaCA=
<string h6KAJbDoHr40EjjPr6CewZlE4kOUfEhXMlGedIJ65JQ </string>
<string 5lMezPzNhHdLaQJYFhdFIaNe16aQn2GfG1LU2ZXtetQ 2ykJeDEwkC5GTI1AKNQ0FQ=
<string ymhZgfHALbx7Ot753Vn91Zdcurc60srl9LWGHfR/RE4 gHtb/R6CEo9/qGigYrlhJA=
<string notifications_ringtone">content://settings/system/notification_sound</string>
<string s8+lbYQ7fOAPQCA9IjWUzHPp8iPGct5WOOhJBtzs5PY +XKzuOGRpqg/Ikub7KkSDA=
<string Jk4vjrwms+DS4H7h+caX0aJbJMl5RVMPv/ADi0q3Ecg P1WRj74m52QRG1OhoKTQQg=



15. Resolvido? kkk.

Edmar
edmarssouzap

(usa Debian)

Enviado em 17/07/2016 - 13:16h

Boa tarde!!!

Cara, eu vou contribuir com um script que resolverá seu problema, mas precisa de uns retoques, por exemplo, solucionar as linhas em brancos do resultado final, será sua lição de casa. kkkk.

script.sh:

#!/bin/bash
# Pega o caminho do arquivo que será tratado
ARQ_ENTRADA="${1}"
# Conta quantas linhas serão tratadas
QUANT_STRING=$(sed '/<string/!d' < "${ARQ_ENTRADA}" | wc -l)

for ((i=1; i<=${QUANT_STRING}; i++)); do
# Faz o jogo de mágica e guarda na variável
STRING_EXTRAIDA=$(cat $ARQ_ENTRADA | sed '/<string/!d;' | sed "${i},${i}!d" | sed 's/<[^>]*>//g')

echo "STRING${i}: $STRING_EXTRAIDA"
done

Na linha de comando digite assim:
script.sh arquivo_a_ser_tratado 


Eu não tive tempo o bastante para pensar em uma maneira melhor, como o uso de retrovisores no sed, mas por agora, isso já resolve.
Por favor, se resolver seu problema ou tiver dúvidas, volte e agradeça as pessoas que te ajudaram.

Tenha um grande dia.
Até.



16. Re: como encontrar uma string e depois pegar só uma parte dela usando o terminal? [RESOLVIDO]

Vinicius Bastos
vini122

(usa Outra)

Enviado em 17/07/2016 - 14:26h

ctw6av escreveu:

Isso parece ser realmente hard mas não é, sem frufrusinhos fica assim:
cat arquivo.txt | sed 's/name="//1;s/=">/ /;s/=:.*//' | egrep ' <' > saida.txt 

Falta alguns retoques finos mas ai já está quase pronto, teste e veja se é isso.

Saida é:
    <string 7i2BCGuwFtKXGn3Pi9IHoCwGRTIF0IiDekNySbbTr5A yLHG5RXLEqtkWF2NXik2ag=
<string UVVa8jXcus8ebMs5zn+XvkmZx37ktdkWQdsLcCDZIB4 PD2n7WwPwcOiRWqG8kZoww=
<string YnzwPd+CWs1WJgPCwzh5MLMz0Eihd8ujxzNgEsJcGjE 6ZBv+tLrW/2bJZZRC1sl0w=
<string /bfNm+HCmVQ8avIbU6alDSnrJjt6NcJkIRjOWYQJF1A mUWfZoV8/r+O/ZJtAt6mFA=
<string appLanguage">default</string>
<string sFULQ06JMvuYJmjW0AK3Xm75iOTnQwvr93D8TLfBo30 eLLwqd0+Ohu+E/XggAzOjQ=
<string zA3lC31FSfNG+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q tCfG0jRRLFulyr2sICTYMg=
<string CLNmMhVh/KvWP3pqDLaGIpeU3EG4e+4GiuKf08q+Ha8 g5sWp8sZMRAZmh0tp6XA7Q=
<string 3ot50Q1aEIqm3s703t3SWwebYPpXLJkVKbDuCF2/s7c MIWeGX/W1tHka7yUCiBCCQ=
<string DsIUeOEaty+39wcupYKcO+R+39J1CuEqPMQ7ZF17V7c Hi0l/68Bo9T5kv0nLRZn5A=
<string I59Z7VXnN8dxR89VrQwbAwttfudIp0JpUvm4UtWpNeU njOJDOp3auW7gqN+k/lVjA=
<string vzu4uLvxAwLFTXnSIkIvuOyF25Yo759KAn2zyXnBYqc 5MKEjpuVHYUkZXrFbkzGmQ=
<boolean appsFilterDisplay" value="false" />
<string EPK2V/UoGHH+ezpru4RON9TOM7tlENNPmrt6QQT5AWc y01jbbi0jHlF0aUEBuUfaA=
<string E8uKK7KQWhbK5A3rEud0ZOG3UR7VAJNaA6SR1VnVRl8 tCWIUMvqSRnWqfTkCJP7VQ=
<boolean 3.1.0" value="true" />
<string BPiZbadjt6lpsQKO4wB1aerzpjVIbdqyEdUSyFud+Ps 00cQtkbhuWzZJIfDBrZHiQ=
<string R0CuY0ewFywBJU/1W65a/1GZ9ERuf21kPUAYWz9HUUU tnh2M+00ltF0Ed6Mp0tmCw=
<string XohImNooBHFR0OVvjcYpJ3NgPQ1qq73WKhHvch0VQtg E3EyYxr6Wd1Ativwm1EQ7g=
<string h4F1ZIDmCuClfi/fp1b69+nzyHj8u1GfU22QZLQ0N2k 5QXKnLmaFEigtsvhiMN9QQ=
<string gc5QzCO+iqaVH4KIC5Q+zn2YrvdlWZKA47GuemrLIuQ 30YcKf/lFBRXHIPQ4GJd6Q=
<string XTbx5K9+lVEVEn5ufSf5wkwtgM/nJiP8y4JlT/shi9Q Nqugx/co3n/lSxfiLpzC/g=
<string YxN5Lb6ydaBObc23WXkXvNnNyXtl2wOpLkcFOQItVi4 okp126pMe1I3sRlD2+9rog=
<string 6Jfq5qkgYV0C1EgZ+/fWVlW5VizHrevsGhf92EEXXrc XJoIJ+SRrxBlZFXcBmZ+nw=
<string 1zngsr9kzOaLUz+thIhGT3OSfBUAfoPbUWIACR6XS2Q </string>
<string /eqiCERiLL4s0q6sxLFxqqDo1li9uRDWOT4MIwbbD5M wZqX+UZqpEEuZFi56qPkaw=
<string dMTQeqa04zK5IM7DkoENbK2NWoCu7sumPDNbDPD7sTU </string>
<string PugTG2UhPOxHfvlA6OJJJ4xZFi90ksIB5ZKe6cbxSjM 37im7iCov2GKId2aiXNvuQ=
<string +NOXoz/LlyXbllAeZTvzz6RFXFY5SCuZNsIrIhY01lk /iTrMrxFHJdx8zf33/66Tg=
<string uzXoGDroWz9wunSwtIud70SSrPQpVOE7REM34OO/680 PMrT6nt0wymPWgp2kx1S3A=
<string uk3+jLW/V9ON/OMehPpwZqb0FKkK9eri6o7fz14DBEc ums3F1JCyOD3LiEqRnmVjg=
<string v5a6Kj3Ej2hP8a6m6Jdww7BXXIKTvAIEQfhyvZrk7RA MLpUvfuoobQ18z5Xl74UlQ=
<string AUqiKvudHqksgc1I2y4+BLZ/ka04M+eNppjM4qAxKzc 0tiTcOJ0Q+uviZRY9s+BFw=
<string hUZYJT/SS9Z2PUGmcaZdOv2nj/MQT3ZsJeQbAyQDtTM IZASwkGVflKt8OvYEiGaCA=
<string h6KAJbDoHr40EjjPr6CewZlE4kOUfEhXMlGedIJ65JQ </string>
<string 5lMezPzNhHdLaQJYFhdFIaNe16aQn2GfG1LU2ZXtetQ 2ykJeDEwkC5GTI1AKNQ0FQ=
<string ymhZgfHALbx7Ot753Vn91Zdcurc60srl9LWGHfR/RE4 gHtb/R6CEo9/qGigYrlhJA=
<string notifications_ringtone">content://settings/system/notification_sound</string>
<string s8+lbYQ7fOAPQCA9IjWUzHPp8iPGct5WOOhJBtzs5PY +XKzuOGRpqg/Ikub7KkSDA=
<string Jk4vjrwms+DS4H7h+caX0aJbJMl5RVMPv/ADi0q3Ecg P1WRj74m52QRG1OhoKTQQg=


Era tipo isso mas vlw.


17. Re: como encontrar uma string e depois pegar só uma parte dela usando o terminal? [RESOLVIDO]

Vinicius Bastos
vini122

(usa Outra)

Enviado em 17/07/2016 - 14:27h

edmarssouzap escreveu:

Boa tarde!!!

Cara, eu vou contribuir com um script que resolverá seu problema, mas precisa de uns retoques, por exemplo, solucionar as linhas em brancos do resultado final, será sua lição de casa. kkkk.

script.sh:

#!/bin/bash
# Pega o caminho do arquivo que será tratado
ARQ_ENTRADA="${1}"
# Conta quantas linhas serão tratadas
QUANT_STRING=$(sed '/<string/!d' < "${ARQ_ENTRADA}" | wc -l)

for ((i=1; i<=${QUANT_STRING}; i++)); do
# Faz o jogo de mágica e guarda na variável
STRING_EXTRAIDA=$(cat $ARQ_ENTRADA | sed '/<string/!d;' | sed "${i},${i}!d" | sed 's/<[^>]*>//g')

echo "STRING${i}: $STRING_EXTRAIDA"
done

Na linha de comando digite assim:
script.sh arquivo_a_ser_tratado 


Eu não tive tempo o bastante para pensar em uma maneira melhor, como o uso de retrovisores no sed, mas por agora, isso já resolve.
Por favor, se resolver seu problema ou tiver dúvidas, volte e agradeça as pessoas que te ajudaram.

Tenha um grande dia.
Até.


Depois verei isso muito obrigado.


18. Re: como encontrar uma string e depois pegar só uma parte dela usando o terminal? [RESOLVIDO]

Vinicius Bastos
vini122

(usa Outra)

Enviado em 17/07/2016 - 14:29h

msoliver escreveu:

vini122 escreveu:
como estou fazendo testes deixei só isso
<string name="gshdhhdd+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q=">JBrASyhJ41pYZtdc6o0lTA==:ule0oL3h2BlbqhC8TlhdepvfMKkilDnLWxkx3nrIs8o=:ULf0S4v7X+4hvaf2X4qsuJGq0aUlQU1S2K9fTiWbeC0=</string> 


Mas oque realmente tem é
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="7i2BCGuwFtKXGn3Pi9IHoCwGRTIF0IiDekNySbbTr5A=">yLHG5RXLEqtkWF2NXik2ag==:a0mwksKpyDDHmDjcAA5GQ6tE0Yc7r8zYSodBJIV983o=:YLt24TF2QRlJTvZDXvsWmQ==</string>
<string name="UVVa8jXcus8ebMs5zn+XvkmZx37ktdkWQdsLcCDZIB4=">PD2n7WwPwcOiRWqG8kZoww==:5J+Gs/5fu49QOs+9ai0/94VRK/aZiNF8aNITo9KM/8s=:7JyUZmqry3/ALUNTmaGKNA==</string>
<string name="YnzwPd+CWs1WJgPCwzh5MLMz0Eihd8ujxzNgEsJcGjE=">6ZBv+tLrW/2bJZZRC1sl0w==:WX5LXpaUlY7PjLwF9NKDx5Icwl41QqVARCkvbK9IwIE=:zv1YJxj9YteOT/LTlVwqxA==</string>
<string name="/bfNm+HCmVQ8avIbU6alDSnrJjt6NcJkIRjOWYQJF1A=">mUWfZoV8/r+O/ZJtAt6mFA==:tMFqUwqIUEMO3Lt5lThRkDU2p+pYDHUQ+0E8FSm02K0=:WiBCixARA6TrJ3h7rEVK1Q==</string>
<string name="appLanguage">default</string>
<string name="sFULQ06JMvuYJmjW0AK3Xm75iOTnQwvr93D8TLfBo30=">eLLwqd0+Ohu+E/XggAzOjQ==:RKSSYazr9QoJNT1mEMUayCABds72ZQ9aaTakpF4Ysdk=:Sf2e6iDLXZMU0eJ7LHQiYg==</string>
<string name="zA3lC31FSfNG+vF1KfnYnlHbk+LFk5Y+HqaZXbEjc9Q=">tCfG0jRRLFulyr2sICTYMg==:kWyZRkcfSlHy2l5VHy23gWIsHqzWlhJK5xRK/AptQXw=:vGkm0A/OWn3DBg6jUw7ic7vj4OvuOUEOC7Vjyzuu0Lo=</string>
<string name="CLNmMhVh/KvWP3pqDLaGIpeU3EG4e+4GiuKf08q+Ha8=">g5sWp8sZMRAZmh0tp6XA7Q==:GFLFXBgCuAKvsMPz23peOv+uWURLif6Q3MOShxZPb9k=:0GDGfjJGLvPU9/6fqC7KpA==</string>
<string name="3ot50Q1aEIqm3s703t3SWwebYPpXLJkVKbDuCF2/s7c=">MIWeGX/W1tHka7yUCiBCCQ==:yJ+9N3eZ9jU40YyfK2FOy8f6yvoyNqQgUpS7t5sLm50=:0wMqCv6VYfV+PaG487TLKw==</string>
<string name="DsIUeOEaty+39wcupYKcO+R+39J1CuEqPMQ7ZF17V7c=">Hi0l/68Bo9T5kv0nLRZn5A==:Y3EnOYy1jmpUzR2CAd4exsD8q37vqGGftoKYvwCPZdo=:ju/r2ii/DaJjClyJhDIdSA==</string>
<string name="I59Z7VXnN8dxR89VrQwbAwttfudIp0JpUvm4UtWpNeU=">njOJDOp3auW7gqN+k/lVjA==:7P2CnH1dv+XhFHOKsjb5Rp80yGmSPEdwKuhQtzyHgKw=:UbUPFF2dFIuabgQzuy+qFJtQVudCrRn9FTU82F1pWabksnjfbWI63b20l1RME29QxgkBO6NqjnhcXSsNHt+VUiKsT0rd5ny56wUtKuBsoabW37jZ54ga3q8C9wtRxftmb3rNfO+OCs0ksQt6dhFLL/85RDWqKmmhQ9Y3JQlLEQZBMV5KI0g1f3z9ah5YWu5E</string>
<string name="vzu4uLvxAwLFTXnSIkIvuOyF25Yo759KAn2zyXnBYqc=">5MKEjpuVHYUkZXrFbkzGmQ==:IhU+iUENyhXamkO6BEOaUlNWj9FIvAZh+Bks5iDx3io=:R7ysEbn89VX6DKUrbQ2kEg==</string>
<boolean name="appsFilterDisplay" value="false" />
<string name="EPK2V/UoGHH+ezpru4RON9TOM7tlENNPmrt6QQT5AWc=">y01jbbi0jHlF0aUEBuUfaA==:pLynS3EITkNs3RQxTIDwH1AATwmSEumsMLT/Q8DkEGA=:DNhOP5vrwXQfT5ieMmFNlg==</string>
<string name="E8uKK7KQWhbK5A3rEud0ZOG3UR7VAJNaA6SR1VnVRl8=">tCWIUMvqSRnWqfTkCJP7VQ==:H7N5gEExbM6bm898IkQ7QuiLT9+H1nlNDgb2IM2Zmlw=:KaSMGQ/7ccSJ93C0zaOM3Q==</string>
<boolean name="3.1.0" value="true" />
<string name="BPiZbadjt6lpsQKO4wB1aerzpjVIbdqyEdUSyFud+Ps=">00cQtkbhuWzZJIfDBrZHiQ==:thZQuHfdB5zSU9Ii5pPqPji3BJpb+XzQFlPYByI5DDs=:LfvxVYDzaFy1AUgAyMr3SA==</string>
<string name="R0CuY0ewFywBJU/1W65a/1GZ9ERuf21kPUAYWz9HUUU=">tnh2M+00ltF0Ed6Mp0tmCw==:KE5CMjuFty7CkJsnBaGthju3GJyhhH7LQR1fmV2uB/8=:/wrxpxDTC/zZnlVaxDoJ+w==</string>
<string name="XohImNooBHFR0OVvjcYpJ3NgPQ1qq73WKhHvch0VQtg=">E3EyYxr6Wd1Ativwm1EQ7g==:12L3R+y2wP1vX3RqLZbBuCM+mO1Hw+yuctD1vVTljkk=:6pu9mCxT5EJbVviq/Meyrg==</string>
<string name="h4F1ZIDmCuClfi/fp1b69+nzyHj8u1GfU22QZLQ0N2k=">5QXKnLmaFEigtsvhiMN9QQ==:2ELMC/oEy6easZYgbond9R7uV2AJEldyilP7lJE8YBs=:2wCAjSA/8vif/kvPS9OMWA==</string>
<string name="gc5QzCO+iqaVH4KIC5Q+zn2YrvdlWZKA47GuemrLIuQ=">30YcKf/lFBRXHIPQ4GJd6Q==:VkDjkmkqzhJNhfBX8fbGQq/Cxm73hmH+iOuiGowkkWY=:1S1fG9e6WRm3XKXLV52Ryw==</string>
<string name="XTbx5K9+lVEVEn5ufSf5wkwtgM/nJiP8y4JlT/shi9Q=">Nqugx/co3n/lSxfiLpzC/g==:gplxdpFSfI1GNVYJ2pinZTif7w/qJgRTwgKWZlCA6MY=:ayGecKNk/vOwJi7IvoQdyNm1QqzFH4nWiZ8sOaEVinlOJyWobkGM5YqdTU1Y8M3MtyVEPs6jNX/J0CCFpLy1G6V5HUWjWFXod7Wr4RcuUXPspTjV9K9EijrpBCpglD8pLwBr+L9FBIcCyUQOQ0jnJpQuy36juP4HiCzfxR/hFC8QLts0a1WIrAz/6gNrJhKdPQAz6i3TM1R4eJIgE20NAh1cW81S1BtwNtZKZK4TsOr3rngIzaNOpUcga3y6tGg6BnjlYBCpJ24A4Fl4Ex9dutoLXsRGS/qkATi1AU+vNKsDrlqgfpJ+siIgCYRpOPgpPHWA5SIsQgsXqKVF/zUqMCPV/MlmR9jCa69iEqPMIzAy6+B5YzZuopH/8Rlk2Pil6APw4edAoy5M23EuONkmpQIDPeQMbWMKy1XFwn1d6lTZVoRzpcl+t0nRiyXLVH2m</string>
<string name="YxN5Lb6ydaBObc23WXkXvNnNyXtl2wOpLkcFOQItVi4=">okp126pMe1I3sRlD2+9rog==:gWv9HXoksoBoJpPiDS0Pd9GOpuqlEi7o400prmJMcx0=:q+wD8DZenCeOcVOMmlL7RA==</string>
<string name="6Jfq5qkgYV0C1EgZ+/fWVlW5VizHrevsGhf92EEXXrc=">XJoIJ+SRrxBlZFXcBmZ+nw==:vE1wWFp43PQSxLLkcPxAqW15vjTienN8pTGHFLIfgYA=:p3gAKuz0FXWBbLeI9eL/0w==</string>
<string name="1zngsr9kzOaLUz+thIhGT3OSfBUAfoPbUWIACR6XS2Q="></string>
<string name="/eqiCERiLL4s0q6sxLFxqqDo1li9uRDWOT4MIwbbD5M=">wZqX+UZqpEEuZFi56qPkaw==:8A5/RPuyFfduopDdWxDFWs7dO9xTMe28o27yDgIKVdM=:uI0bUtp8Uax2SX1At3HPlA==</string>
<string name="dMTQeqa04zK5IM7DkoENbK2NWoCu7sumPDNbDPD7sTU="></string>
<string name="PugTG2UhPOxHfvlA6OJJJ4xZFi90ksIB5ZKe6cbxSjM=">37im7iCov2GKId2aiXNvuQ==:SSL4xUbCdHQvl8/FW7kg7l7ddG7oU/Y0WlxQSvN9Qgc=:VS06ch2pZxZp7usdzz87rE/VnvVHb8FjUrfgd7QbjadSPskjfDWkS0zSrnRUgcwx9DDEF2RooYiwnQ0zWgkcO+kz+GyMlOL2t/RkowZ3Ec/LGV5OsnPiyHtrkCnuFDe2</string>
<string name="+NOXoz/LlyXbllAeZTvzz6RFXFY5SCuZNsIrIhY01lk=">/iTrMrxFHJdx8zf33/66Tg==:JSHXkxyI4cOQAZGeGZOxuQoq8gnBs/OWZhZJXvphwjo=:yfkqpoaU2Hakpgqy7ib9yg==</string>
<string name="uzXoGDroWz9wunSwtIud70SSrPQpVOE7REM34OO/680=">PMrT6nt0wymPWgp2kx1S3A==:GRsYX6KdFvV1tcCe7Loh2qz+mF2RDbPNAlU8UOylnbk=:HgRsOReTm4M3Vf2zndDaBw==</string>
<string name="uk3+jLW/V9ON/OMehPpwZqb0FKkK9eri6o7fz14DBEc=">ums3F1JCyOD3LiEqRnmVjg==:ro3rHWrN8sydFznp2ME18yQ3bnE7+hbAu8CaAc1AlUg=:gedX96sUDheUvTGmpKocJw==</string>
<string name="v5a6Kj3Ej2hP8a6m6Jdww7BXXIKTvAIEQfhyvZrk7RA=">MLpUvfuoobQ18z5Xl74UlQ==:I9qhAgLxrsYrQR2SUiKnqF9a2R+ZuDEl584RamMsLMs=:Mxr5pR0oTK9zDsvq3lHLhA==</string>
<string name="AUqiKvudHqksgc1I2y4+BLZ/ka04M+eNppjM4qAxKzc=">0tiTcOJ0Q+uviZRY9s+BFw==:deN3ymwXldTH+APXQyRu4n8SQ8iBgE3Mll1kH8FAe4g=:l0hoI4Knui4IXlcsQ0oRng==</string>
<string name="hUZYJT/SS9Z2PUGmcaZdOv2nj/MQT3ZsJeQbAyQDtTM=">IZASwkGVflKt8OvYEiGaCA==:cuJUq6fhwA/IviP9MG/N8jgDEK4nEJZh7zFGRpiBhfk=:wc0gV2ff/wswGFwQCb7ecw==</string>
<string name="h6KAJbDoHr40EjjPr6CewZlE4kOUfEhXMlGedIJ65JQ="></string>
<string name="5lMezPzNhHdLaQJYFhdFIaNe16aQn2GfG1LU2ZXtetQ=">2ykJeDEwkC5GTI1AKNQ0FQ==:JMeI0uecY/hROC/2CMghjMcRf+y33Vp9hXv9i6EVHbU=:vuFxOljVoFH1TuS+1xOWFA==</string>
<string name="ymhZgfHALbx7Ot753Vn91Zdcurc60srl9LWGHfR/RE4=">gHtb/R6CEo9/qGigYrlhJA==:YVfwQpV1kT/zVhdzLqa8A5nXDWC3xxnDHc42gkaLb9U=:xKmjPdRg4Ri+PiDdCdJPmrNCHt8Ka5KBtdf+hkEF0ZigiSB0SuAJk7zbNJ5zVVSkhYdAh7GsQCrahawXAkCsh0sh5fVJCypZDGBd3lmRsZQsIPes26miXkiXczM8MAtmYQqciMdjfMssqGvD1i6ERSk8tdCt3o+ovPCYtxjnpTq5sx8I0VTOdbLNalpSMr2tLYBVlX0mcSdIY3+SrMtdKnaWuOU49b8VqD17o2ioIdIQZto4bv2HRtFeITnQMhBAL+udwn0Lz1qWojITO/1sJiWhNvhymGeHaKh82T5hZ5/q25e7C1fn6hzzxrFBDKafWdMBvLNSCpXkCuhNeTFYIv8u+GZ6PEEnreQSZUn3jz/RzYSJ4+wYWu/dELYLGu7D2jTo8SVW40LmCduZYDdQZyJJuYRduAIWASHn2SeNLnBd+v156kEGiJMDsGqR+Iwf</string>
<string name="notifications_ringtone">content://settings/system/notification_sound</string>
<string name="s8+lbYQ7fOAPQCA9IjWUzHPp8iPGct5WOOhJBtzs5PY=">+XKzuOGRpqg/Ikub7KkSDA==:tLMIqQeCTwymiDOHJxr/g3CSIsNWpGfpGabWRFJV4Ak=:zw+UmkyqRTEbII+4Lk0cH9CNo+CeGDbeYgus5AQaKlXcOC9E/3YFMDbXEUIQaNCY</string>
<string name="Jk4vjrwms+DS4H7h+caX0aJbJMl5RVMPv/ADi0q3Ecg=">P1WRj74m52QRG1OhoKTQQg==:tDn45aS1j6yTTeqzS+EN4eHv5+ZOMVyBMwk7raUto4A=:FqYqA8JIpFDsgcieYZ49iA==</string>
</map>


pois é isso, se puder explique a variável que pedi.


Boa tarde Vini.
Com o arquivo completo, fica mais fácil . . .
Seguinte, alterei a lógica . . .
O comando:
sed -r 's/>/& /;s/</ &/2' /sdcard/11.txt
ALTERA ">" PARA "> " e "<" PARA " <".
Desa forma, tenho os CAMPOS separados por ESPAÇO.
Feito isso, direciono para o awk, verifico se o CAMPO 2 "CASA" com a REGEX "/gshdhhdd/",
CASANDO, imprimo o CAMPO 3 (que é o pretendido).

GERA ARQUIVO:
sed -r 's/>/& /;s/</ &/2' /sdcard/11.txt | awk '$2 ~ /gshdhhdd/{print $3}' > STRING.txt 

GERA var STRING:
STRING=$(sed -r 's/>/& /;s/</ &/2' /sdcard/11.txt | awk '$2 ~ /gshdhhdd/{print $3}') 


É isso ai!!!!

E não esqueça, se a resposta foi útil, marque-a como A MELHOR!

att.:
Marcelo Oliver



Sim isso msm bem simplicada.
gostei.
Sem dúvida a melhor solução.



01 02



Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts