Translations:UI and Help files Content Guide/89/en

From The Document Foundation Wiki
Jump to navigation Jump to search

Like grep, sed is a powerful command that let you modify the content of your .po files very easily. Sed stands for Stream EDitor. For example, if you want to substitute Header by Title on a file, the syntax will be:

sed 's/Header/Title/g' <file.po
  • first you have the name of the command s for substitute
  • then you have the original word separated by / delimiters
  • after that the word to substitute to the original
  • g is used for global and will substitute all the occurrences in the file, and not only the first occurrence of the searched word
  • then the file where the substitution takes place
  • note the presence of the single quotes too.

Sed uses regular expressions to manage the instructions, but the syntax will still remain the same as above. We will not detail all the syntax of the lines given bellow, but they are quite simple expressions you can use safely on your files.