Sponsored Content
Top Forums Shell Programming and Scripting Sum value from selected lines script (awk,perl) Post 302360769 by thegeek on Saturday 10th of October 2009 09:04:58 AM
Old 10-10-2009
In Perl it is very simple to do.

But before i work for you, i would want to know what you have tried so far ?!

You should try, and ask for clarifications/advices if you have some difficulties -- which is always good to learn.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extracting selected few lines through perl

How can I extract few lines(like 10 to 15, top 10 and last 10) from a file using perl. I do it with sed, head and tail in unix scripting. I am new to perl. Appreciate your help. (2 Replies)
Discussion started by: paruthiveeran
2 Replies

2. Shell Programming and Scripting

Sum of all lines in file without roundup with awk

Hi, I have a file and I want to sum all the numbers in it. Example of the file: 0.6714359 -3842.59553830551 I used your forum (https://www.unix.com/shell-programming-scripting/74293-how-get-sum-all-lines-file.html) and found a script, what worked for me: awk '{a+=$0}END{print a}'... (8 Replies)
Discussion started by: mario8eren
8 Replies

3. Shell Programming and Scripting

shell script(Preferably awk or sed) to print selected number of columns from each row

Hi Experts, The question may look very silly by seeing the title, but please have a look at it clearly. I have a text file where the first 5 columns in each row were supposed to be attributes of a sample(like sample name, number, status etc) and the next 25 columns are parameters on which... (3 Replies)
Discussion started by: ks_reddy
3 Replies

4. Shell Programming and Scripting

Perl script to find particular field and sum it

Hi, I have a file with format a b c d e 1 1 2 2 2 1 2 2 2 3 1 1 1 1 2 1 1 1 1 4 1 1 1 1 6 in column e i want to find all similar fields ( with perl script )and sum it how many are there for instance in format above. 2 - 2 times 4 - 1 time 6 - 1 time what i use is ... (14 Replies)
Discussion started by: Learnerabc
14 Replies

5. Shell Programming and Scripting

trying to print selected fields of selected lines by AWK

I am trying to print 1st, 2nd, 13th and 14th fields of a file of line numbers from 29 to 10029. I dont know how to put this in one code. Currently I am removing the selected lines by awk 'NR==29,NR==10029' File1 > File2 and then doing awk '{print $1, $2, $13, $14}' File2 > File3 Can... (3 Replies)
Discussion started by: ananyob
3 Replies

6. Shell Programming and Scripting

awk script for getting the selected records from a file.

Hello, I have attached one file named file.txt . I have to create a file using the awk script with the records in which 38th position is P and not V . ex it should have 00501 HOLTSVILLE NYP00501 and it should not include 00501 I R S SERVICE CENTER ... (3 Replies)
Discussion started by: sonam273
3 Replies

7. Shell Programming and Scripting

AWK script - extracting min and max values from selected lines

Hi guys! I'm new to scripting and I need to write a script in awk. Here is example of file on which I'm working ATOM 4688 HG1 PRO A 322 18.080 59.680 137.020 1.00 0.00 ATOM 4689 HG2 PRO A 322 18.850 61.220 137.010 1.00 0.00 ATOM 4690 CD ... (18 Replies)
Discussion started by: grincz
18 Replies

8. Shell Programming and Scripting

Summing over specific lines and replacing the lines with the sum using sed, awk

Hi friends, This is sed & awk type question. I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example ###start of input text file #### abc def ghi 1 2 3 4 kjld random... (3 Replies)
Discussion started by: kaaliakahn
3 Replies

9. UNIX for Dummies Questions & Answers

awk to sum column field from duplicate row/lines

Hello, I am new to Linux environment , I working on Linux script which should send auto email based on the specific condition from log file. Below is the sample log file Name m/c usage abc xxx 10 abc xxx 20 abc xxx 5 xyz ... (6 Replies)
Discussion started by: asjaiswal
6 Replies

10. Shell Programming and Scripting

Shell script count lines and sum numbers from multiple files

I want to count the number of lines, I need this result be a number, and sum the last numeric column, I had done to make this one at time, but I need to make this for a crontab, so, it has to be an script, here is my lines: It counts the number of lines: egrep -i String file_name_201611* |... (5 Replies)
Discussion started by: Elly
5 Replies
gtranslator(1)							  GNOME programs						    gtranslator(1)

NAME
gtranslator -- a comfortable gettext po file editor with many bells and whistles. SYNOPSIS
gtranslator [ --help ] [ --version ] [ -a filename ] [ -e po-file ] [ -g geometry-string ] [ -l po-file-to-learn ] [ -b ] [ -s ] DESCRIPTION
gtranslator is a comfortable gettext po file editor with many features like special char featured editing, plural forms view, div. charset support, comfortable prefs, list view of messages, regular expression based search function, compile/update possiblities and much much more. Of course all standard features of a good application like DnD, session support, supplement files for mime types and menu items are present. Instant comment view, a comfortable quick navigation messages table with customizable colors, colorschemes, UTF-8 support, a high level of preferizabilation and a personal learn buffer/translation memory with autotranslation capabilities are the main features of gtranslator besides the comfortable editing of the translation entries. OPTIONS
-a --auto-translate=po-file Autotranslates the given po file with the entries from the learn buffer and exits afterwards. -e --export-learn-buffer=po-file-to-export Exports the learn buffer contents into the given plain gettext po file and exits. -g --geometry=geometry Let's you specify the geometry of gtranslator's main window. -l --learn=po-file-to-learn Learns the given po file within the command line without starting the GUI. The personal learn buffer is used as a translation memory to autoaccomplish missing translations/entries. -s --learn-statistics Print out some statistics and information about the learn buffer of gtranslator on the commandline. --display With this option you can select on which screen gtranslator should appear. --help Shows you a little help autogenerated by GNOME and with the options mentioned above. --version Prints out the version number of gtranslator. --usage Shows you the pill of options without an explanation. FILES
~/.gconf/apps/gtranslator Your personal gtranslator settings will be stored there. ~/.gtranslator This directory is used by gtranslator for all it's "private" files (e.g. temporary files). ~/.gtranslator/colorschemes/ Your personal colorschemes can be placed in this directory -- gtranslator does also list the colorschemes in this directory in the colorscheme selection box. ~/.gtranslator/etstates/ The state file for the messages table/tree is stored in this directory. ~/.gtranslator/umtf/ Your personal learn buffers (in UMTF format) are stored in this directory -- the learn buffer is used for auto translation issues. ~/.gtranslator/files/ Temporary files used by gtranslator are stored in this directory (mostly this directory should be empty). LEARN BUFFER
The learn buffer is the implementation of a personal translation memory (TM) in gtranslator. gtranslator uses the UMTF (a compressed XML file which is normally quite good human readable if uncompressed) format for storing it's learned strings. Your learned strings are then available for the autotranslation feature of gtranslator where gtranslator automatically fills in the corre- sponding and valuable translations for any message which has already been learned previously. This results in a fairly high percentage of prefilled/pretranslated messages. The common and good style of working with the learn buffer and with the autotranslation should be to learn the main po/translation files for your language via gtranslator via calling gtranslator -n -l po-file-to-learn on the command line; this will put the translated strings from this po file into your personal learn buffer. You should learn the main po files (for GNOME for example gnumeric, nautilus, evolution or any other bigger, already translated package's po file) for your language); you can use a new script from the gtranslator package to automatise this task a little bit: it's "build- gtranslator-learn-buffer.sh" which is installed into gtranslator's scripts directory which you can see by calling gtranslator -b and you simply execute the script with it's full path and simply follow the information on the command line for it. Afterwards you can simply use the "Autotranslation" menu entry from the GUI or use the "F10" hotkey to let gtranslator autotranslate all missing translations from your personal learn buffer. This will ease your translation work and make a big portion of the po files be pre-translated. With a fairly big personal learn buffer of about 2 MB you can achive many pre-translated messages for a new project/translation. If you want to use the stored learn buffer contents to produce a po file with all the "learned" translations, you can also use the "export learn buffer" capability of gtranslator to get a plain po file version of the learn buffer. USAGE EXAMPLES
Some examples for the options. gtranslator -b Shows you the real build specs/dates of gtranslator. gtranslator -s Give me statistics about the learn buffer of gtranslator. gtranslator -n -l po-file-to-learn Learns the given po file "po-file-to-learn" on the command line without starting up the GUI. gtranslator -a po-file Autotranslates all missing entries from the learn buffer if possible and exits. gtranslator -e po-file-to-export Exports your current learn buffer to the given plain gettext po file ("po-file-to-export"). gtranslator po-file Starts gtranslator with the given po-file loaded on startup. gtranslator -g "460x320+0+0" Lets gtranslator appear on the left upper edge of the screen "+0+0" and gtranslator is sized to "460x320" if possible -- if gtrans- lator needs more size for it's window contents, it'll expand itself to the necessary dimensions -- even if you defined a smaller geometry string. LICENSE
gtranslator is distributed under the GNU GPL V 2.0 or greater. AUTHORS
Ross Golder <ross@kabalak.net>, Fatih Demir <kabalak@kabalak.net> (previously also: Gediminas Paulauskas <menesis@kabalak.net>, Thomas Ziehmer <thomas@kabalak.net>, Kevin Vandersloot <kfv101@psu.edu> and Peeter Vois <peeter@kabalak.net>). WEBSITE
http://www.gtranslator.org BUGREPORTS
You can deliver bug reports to the gtranslator development team to our bug base via http://bugzilla.gnome.org/enter_bug.cgi?product=gtrans- lator VERSION
gtranslator 2.91.4 man-page gtranslator gtranslator 2.91.4 -- 2012-05-11 gtranslator(1)
All times are GMT -4. The time now is 09:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy