Sponsored Content
Top Forums Shell Programming and Scripting Get the total of a field in all the lines of a group Post 302253403 by appsguy616 on Friday 31st of October 2008 01:26:54 PM
Old 10-31-2008
Hi
I want the total of the field at position 30-39 on all Lines 6 to be displayed. so Every 5 line will have only one 6 line with the total of all the lines 6

Thanks
Pls help
so the total sum of of all the values in quotes " " should be dispalyed in the first 6 line and delete remaining. similarly for the other 5 line do the same.

101 12110825030430021170810060810A094101BANK OF AMERICA
5200AMERICAN EXP 144892 3043002117CCDOCT06 2008
62201100123409-1960 "0000137684"60000526 AMERICAN
62201100123409-1960 "0000852630"60000526 AMERICAN
62201100123409-1960 "0000041889"60000526 AMERICAN
62201100123409-1960 "0000259602"60000526 AMERICAN
62201100123409-1960 "0000093900"60000526 AMERICAN
62201100123409-1960 "0000286610"60000526 AMERICAN
62201100123409-1960 "0000066560"60000526 AMERICAN
62201100123409-1960 "0000040473"60000526 AMERICAN
62201100123409-1960 "0000025000"60000526 AMERICAN
5200AMERICAN EXP 144892 3043002117CCDOCT07 2008
62201100123409-1960 000023768460000526 AMERICAN
62201100123409-1960 000025263060000526 AMERICAN
62201100123409-1960 000024188960000526 AMERICAN
705RMR*11*379477306771000*0000133379

Last edited by appsguy616; 10-31-2008 at 02:32 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

total number of lines

Hi have following file |abcd 2|abcd |sdfh |sdfj I want to find total number of files haivng nothing in feild 1 using awk will command awk -F "|" '( $1=="") {print NR}' test_awk will work??? (4 Replies)
Discussion started by: mahabunta
4 Replies

2. Shell Programming and Scripting

Awk-Group count of field

Hi, Suppose if i am having a file with following records as given below. 5555 6756 5555 4555 4555 6767 how can i get the count of each record using AWK. Eg:5555 count should be 2 4555 count should be 2 6767 count should be 1 ... (5 Replies)
Discussion started by: tinivt
5 Replies

3. Shell Programming and Scripting

need to delete all lines from a group of files except the 1st 2 lines

Hello, I have a group of text files with many lines in each file. I need to delete all the lines in each and only leave 2 lines in each file. (3 Replies)
Discussion started by: script_op2a
3 Replies

4. Shell Programming and Scripting

Adding total of first field for each number in the second field

Dears, I need a script or command which can find the unique number from the second filed and against that number it adds the total of first field . 17215630 , 0 907043 ,1 201050 ,10 394149 ,4 1964 ,9 17215630, 0 907043 ,1 201050, 10 394149 ,4 1964 ,9 1234234, 55 23 ,100 33 ,67 ... (2 Replies)
Discussion started by: shary
2 Replies

5. Shell Programming and Scripting

Select lines in which column have value greater than some percent of total file lines

i have a file in following format 1 32 3 4 6 4 4 45 1 45 4 61 54 66 4 5 65 51 56 65 1 12 32 85 now here the total number of lines are 8(they vary each time) Now i want to select only those lines in which the values... (6 Replies)
Discussion started by: vaibhavkorde
6 Replies

6. Shell Programming and Scripting

Transpose, Group, and Total

Need help with some data below. I would like to transpose rows of column c, h to columns with those labels(c,h.) I would then like to sort and group by the values in columns c then h. For column h I would like to further sort by the parenthesis values. After the sort I would like an... (3 Replies)
Discussion started by: ravzter
3 Replies

7. Shell Programming and Scripting

awk repeat one field at all lines and modify field repetitions

Hello experts I have a file with paragraphs begining with a keeping date and ending with "END": 20120301 num num John num num A keepnum1 num num kathrin num num A keepnum1 num num kathrin num num B keepnum2 num num Pete num num A keepnum1 num num Jacob num... (2 Replies)
Discussion started by: phaethon
2 Replies

8. Shell Programming and Scripting

How to add subtotal and total according 3rd field mentioned below table?

111AKKK|SHA|20|25 111|AKKK|SHA|15|35 112|ABC|FL|25|45 112|ABC|FL|15|15 115|AKKK|ASH|10|15 115|AKKK|ASH|20|20 112|ABC|FL|25|20 115|AKKK|ASH|30|35 111|AKKK|SHA|10|45 112|ABC|KL|15|15 112|ABC|KL|20|25 115|AKKK|ASH|30|35 please write a shell script output should be below mentioned... (26 Replies)
Discussion started by: udhal
26 Replies

9. Shell Programming and Scripting

Calculate the total 4 field based on the conditions

Please help me to write a script Match with ACNO & NAME if it matched calculate the total val1 val2 val3 and val4 and GT is total of ACNO wise.please check the output Table ----------------- 1005|ANDP|ACN|20|50|10|30 1005|ANDP|ACN|20|10|30|40 1001|AND|NAC|40|50|40|50... (22 Replies)
Discussion started by: kalia4u
22 Replies

10. Shell Programming and Scripting

awk to calculate total and percent off field in file

Trying to use awk to print the lines in file that have either REF or SNV in $3, add a header line, sort by $4 in numerical order. The below code does that already, but where I am stuck is on the last part where the total lines are counted and printed under Total_Targets, under Targets_less_than is... (4 Replies)
Discussion started by: cmccabe
4 Replies
iwidgets::datefield(1)						  [incr Widgets]					    iwidgets::datefield(1)

__________________________________________________________________________________________________________________________________________________

NAME
iwidgets::datefield - Create and manipulate a date field widget SYNOPSIS
iwidgets::datefield pathName ?options? INHERITANCE
itk::Widget <- iwidgets::LabeledWidget <- iwidgets::Datefield STANDARD OPTIONS
background borderWidth cursor exportSelection foreground highlightColor highlightThickness insertBackground justify relief See the "options" manual entry for details on the standard options. INHERITED OPTIONS
disabledForeground labelBitmap labelFontlabelImage labelMargin labelPos labelText labelVariable state sticky See the "labeledwidget" class manual entry for details on the inherited options. WIDGET-SPECIFIC OPTIONS Name: childSitePos Class: Position Command-Line Switch: -childsitepos Specifies the position of the child site in the date field: n, s, e, or w. The default is e. Name: command Class: Command Command-Line Switch: -command Specifies a Tcl command to be executed upon detection of a Return key press event. Name: gmt Class: GMT Command-Line Switch: -gmt Determines whether the date is calculated relative to Greenwich Mean Time. Accepts a boolean value. The default is no. Name: int Class: DateFormat Command-Line Switch: -int Used to specify international date formats. This option must be a boolean value. When set to true, the date is formatted as YYYY- MM-DD. When set to false, it is formatted as MM/DD/YYYY. Note that this format is driven by the 'clock scan' command and that YYYY-MM-DD is supported in Tk 8.4 or later. The default is no. Name: iq Class: Iq Command-Line Switch: -iq Specifies the level of intelligence to be shown in the actions taken by the datefield during the processing of keypress events. Valid settings include high, average, and low. With a high iq,the date prevents the user from typing in an invalid date. For exam- ple, if the current date is 05/31/1997 and the user changes the month to 04, then the day will be instantly modified for them to be 30. In addition, leap years are fully taken into account. With average iq, the month is limited to the values of 01-12, but it is possible to type in an invalid day. A setting of low iq instructs the widget to do no validity checking at all during date entry. With both average and low iq levels, it is assumed that the validity will be determined at a later time using the date's isvalid command. Name: state Class: State Command-Line Switch: -state Specifies one of two states for the datefield: normal or disabled. If the datefield is disabled then input is not accepted. The default is normal. Name: textBackground Class: Background Command-Line Switch: -textbackground Background color for inside textual portion of the entry field. The value may be given in any of the forms acceptable to Tk_Get- Color. Name: textFont Class: Font Command-Line Switch: -textfont Name of font to use for display of text in datefield. The value may be given in any of the forms acceptable to Tk_GetFont. __________________________________________________________________________________________________________________________________________________ DESCRIPTION
The iwidgets::datefield command creates an enhanced text entry widget for the purpose of date entry with various degrees of built-in intel- ligence. METHODS
The iwidgets::datefield command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form: pathName option ?arg arg ...? Option and the args determine the exact behavior of the com- mand. The following commands are possible for datefield widgets: WIDGET-SPECIFIC METHODS pathName cget option Returns the current value of the configuration option given by option. Option may have any of the values accepted by the iwid- gets::datefield command. pathName configure ?option? ?value option value ...? Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the iwidgets::datefield command. pathName get ?format? Returns the current contents of the datefield in a format of string or as an integer clock value using the -string and -clicks for- mat options respectively. The default is by string. Reference the clock command for more information on obtaining dates and their formats. pathName isvalid Returns a boolean indication of the validity of the currently displayed date value. For example, 03/03/1960 is valid whereas 02/29/1997 is invalid. pathName show date Changes the currently displayed date to be that of the date argument. The date may be specified either as a string, an integer clock value or the keyword "now". Reference the clock command for more information on obtaining dates and their formats. COMPONENTS
Name: date Class: Entry The date component provides the entry field for date input and display. See the "entry" widget manual entry for details on the date component item. EXAMPLE
package require Iwidgets 4.0 proc returnCmd {} { puts [.df get] } iwidgets::datefield .df -command returnCmd pack .df -fill x -expand yes -padx 10 -pady 10 AUTHOR
Mark L. Ulferts KEYWORDS
datefield, widget Tk iwidgets::datefield(1)
All times are GMT -4. The time now is 12:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy