![]() |
|
|
google unix.com
|
|||||||
| Fóruns | Registar | Fórum Regimento | Ligações | Álbuns | FAQ | Lista deputados | Calendário | Pesquisa | Today's Posts | Mark Forums Read |
| Programação Shell Script e Post perguntas sobre ksh, CSH, SH, BASH, Perl, PHP, SED, Awk e outros scripts shell e shell scripts línguas aqui. |
Mais UNIX e Linux Fórum Tópicos Você pode achar Helpfull
|
||||
| Fio | Thread Starter | Fórum | Respostas | Última postagem |
| Substitua o arquivo usando sed | senthil_is | Programação Shell Script e | 5 | 11-20-2008 07:58 |
| substituir palavras em arquivo baseado em um outro arquivo | kinmak | Programação Shell Script e | 9 | 05-07-2008 06:06 |
| Substituir palavra em um arquivo | sasiharitha | UNIX para Dummies Perguntas & Respostas | 3 | 12-05-2007 01:11 |
| serach e substituir o nome do ficheiro no caminho em uma remota arquivo xml | kiranreddy1215 | Programação Shell Script e | 1 | 11-12-2007 11:31 |
| Substituir um Valor em Arquivo | lesstjm | Programação Shell Script e | 5 | 05-16-2007 02:20 |
![]() |
|
|
Linkback | Thread Tools | Pesquisar este Thread | Rate Thread | Display Modes |
|
|
|
||||
|
substituir enésimo valor no arquivo xml
Oi tudo,
Tenho application.xml arquivo com a seguinte conteúdo <dependency> <groupId> fr.orange.portail.ear </ groupId> <artifactId> _AdminServicesEAR </ artifactId> <version> 1.0.0-20080521.085352-1 </ version> <tipo> orelha </ tipo> </ dependência> <dependency> <groupId> fr.orange.portail.ear </ groupId> <artifactId> _AdminServicesEAR </ artifactId> <version> 1.0.0-20080521.085352-1 </ version> <tipo> orelha </ tipo> </ dependência> <dependency> <groupId> fr.orange.portail.ear </ groupId> <artifactId> _AdminServicesEAR </ artifactId> <version> 1.0.0-20080521.085352-1 </ version> <tipo> orelha </ tipo> </ dependência> Quero substituir enésimo <tipo> tag valor (ou seja: orelha) com "OK", utilizando sed ou awk .... Eu tentei algo como isto para substituir a primeira ocorrência ... mas não funciona. ![]() gato application.xml | awk '/ \ <type\> \ (.* \) \ <\ / tipo \> / \u003d (n + 1) (if (n \u003d\u003d 1) (gensub (/ \ <type\> \ (.* \) \ </ tipo \> /, "OK", $ 0));) print ' Pode qualquer um queira dizer a sintaxe correta do presente? Thanks and Regards, Subin |
![]() |
| Marcadores |
| Thread Tools | Pesquisar este Thread |
| Display Modes | Esta taxa Thread |
|
|