but that didn't work, the new line wasn't added after each ; in the output file (testing2.txt)
---------- Post updated at 05:46 PM ---------- Previous update was at 05:26 PM ----------
This worked perfectly
Thank you.
Quote:
Originally Posted by gary_w
This also assumes you don't want a newline at the end of every line, else the above post is your answer. You didn't say if every line ended in a ';'.
One way is to use the stream editor sed. Search for a ';' and replace it with a ';' followed by a <newline> on every occurrence on a line. Note pressing Ctrl-V allows one to enter a control character.
Hi
I need some help using shell script to edit a file.
My original file has the following format:
/txt/email/myemail.txt
/txt/email/myemail2.txt
/pdf/email/myemail.pdf
/pdf/email/myemail2.pdf
/doc/email/myemail.doc
/doc/email/myemail2.doc
I need to read each line. If the path is... (3 Replies)
I have a requirement, which is as follows
*. Folder contains list of xmls. Script has to create new xml files by copying the existing one and renaming it by appending "_pre.xml" at the end.
*. Each file has multiple <Name>fileName</Name> entry. The script has to find the first occurance of... (1 Reply)
Hi all,
I need to write an automated bash shell script which performs such operations:
1. Grep the header of everyline with the initial of "T" in "FILE_A"
2. Perform a for loop,
Count the numbers of comma in the line of code,
if (no. of comma < 17)
ADD the comma until 17;
... (2 Replies)
Can we use a here document inside a here document?
Something like this
ssh user@remotehost << REMOTE
sudo vserver vsernamename enter << VSERVER
perform actions on vserver.
VSERVER
REMOTE (6 Replies)
dear all,
i need your help to change this input to output
M9_3D_H10__Dflt
->SP_M9N_S
497224.3125 1598028.1250
497063.2813 1598002.7500
496953.1250 1597951.8750
497122.6250 1597985.7500
497190.4375 1597994.2500... (3 Replies)
How to edit file content at the specific line? For example at below
The things to edit --> This is line 2. And it is below line 1.
This is line 1.
This is line 2. # i want to append some words at this row line. How?
This is line 3. (8 Replies)
Hi Experts,
I am new to shell scripting. Need some help in doing one task given by the customer.
The sample record in a file is as follows:
3538,,,,,,ID,ID1,,,,,,,,,,,
It needs to be the following:
3538,,353800,353800,,,ID,ID1,,,,,COLX,,,,,COLY,
And i want to modify this record in... (3 Replies)
I'm working on a script to execute a number of items. One being, editing particular files to add certain lines. I'm attempting to utilize sed, but, having issues when running from a bash script. Assistance is greatly appreciated.
My example:
sed -i '14 i\
# add these lines
add these lines to... (5 Replies)
Discussion started by: Nvizn
5 Replies
LEARN ABOUT LINUX
po4a-translate
PO4A-TRANSLATE(1) User Contributed Perl Documentation PO4A-TRANSLATE(1)NAME
po4a-translate - convert a PO file back to documentation format
SYNOPSIS
po4a-translate -f fmt -m master.doc -p XX.po -l XX.doc
(XX.doc is the output, all others are inputs)
DESCRIPTION
The po4a (PO for anything) project goal is to ease translations (and more interestingly, the maintenance of translations) using gettext
tools on areas where they were not expected like documentation.
The po4a-translate script is in charge of converting the translation (which was done in a PO file) back into the documentation format. The
provided PO file should be the translation of the POT file which was produced by po4a-gettextize(1).
OPTIONS -f, --format
Format of the documentation you want to handle. Use the --help-format option to see the list of available formats.
-a, --addendum
Add a file to the resulting file (to put translator's name or a section "About this translation", for example). The first line of the
file to insert should be a PO4A header indicating where it should be added (see section HOWTO add extra text to translations in
po4a(7)).
-A, --addendum-charset
Charset of the addenda. Note that all the addenda should be in the same charset.
-m, --master
File containing the master document to translate.
-M, --master-charset
Charset of the file containing the document to translate.
-l, --localized
File where the localized (translated) document should be written.
-L, --localized-charset
Charset of the file containing the localized document.
-p, --po
File from which the message catalog should be read.
-o, --option
Extra option(s) to pass to the format plugin. Specify each option in the 'name=value' format. See the documentation of each plugin for
more information about the valid options and their meanings.
-k, --keep
Minimal threshold for translation percentage to keep (i.e. write) the resulting file (default: 80). I.e. by default, files have to be
translated at at least 80% to get written.
-w, --width
Column at which we should wrap the resulting file.
-h, --help
Show a short help message.
--help-format
List the documentation formats understood by po4a.
-V, --version
Display the version of the script and exit.
-v, --verbose
Increase the verbosity of the program.
-d, --debug
Output some debugging information.
Adding content (beside translations) to generated files
To add some extra content to the generated document beside what you translated (like the name of the translator, or a "About this
translation" section), you should use the --addendum option.
The first line of the addendum must be a header indicating where to put it in the document (it can be before or after a given part of the
document). The rest of the file will be added verbatim to the resulting file without further processing.
Note that if po4a-translate fails to add one of the given files, it discards the whole translation (because the missing file could be the
one indicating the author, what would prevent the users to contact him to report bugs in the translation).
The header has a pretty rigid syntax. For more information on how to use this feature and how it works, please refer to the po4a(7) man
page.
SEE ALSO po4a-gettextize(1), po4a-normalize(1), po4a-updatepo(1), po4a(7)AUTHORS
Denis Barbier <barbier@linuxfr.org>
Nicolas Francois <nicolas.francois@centraliens.net>
Martin Quinson (mquinson#debian.org)
COPYRIGHT AND LICENSE
Copyright 2002-2012 by SPI, inc.
This program is free software; you may redistribute it and/or modify it under the terms of GPL (see the COPYING file).
perl v5.14.2 2012-05-17 PO4A-TRANSLATE(1)