Sponsored Content
Full Discussion: Get previous value in column
Top Forums Shell Programming and Scripting Get previous value in column Post 302979576 by RudiC on Tuesday 16th of August 2016 11:20:50 AM
Old 08-16-2016
You have a format string for two integer values, you supply two integer variables, and your printout is two integers. Your desired output has three integer values. Where do you think you should start considering modifications?
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

2. UNIX for Dummies Questions & Answers

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (1 Reply)
Discussion started by: yerruhari
1 Replies

3. Shell Programming and Scripting

eAdd two fields in a column if their previous field values are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output file as follows If field3 in file1 is same as field3 in the next line then the field4 should add... (1 Reply)
Discussion started by: yerruhari
1 Replies

4. Shell Programming and Scripting

Compare two files using awk or sed, add values in a column if their previous fields are same

Hi All, I have two files file1: abc,def,ghi,5,jkl,mno pqr,stu,ghi,10,vwx,xyz cba,ust,ihg,4,cdu,oqw file2: ravi,def,kishore ramu,ust,krishna joseph,stu,mike I need two output files as follows In my above example, each row in file1 has 6 fields and each row in file2 has 3... (3 Replies)
Discussion started by: yerruhari
3 Replies

5. Shell Programming and Scripting

Previous Column Value (addition)

Good day, First off, I would just like to say that I've been helped by a lot of the posts here in my own scripting work in the past few months. I've been a long time roamer, but first time poster. That being said, I'm stuck trying to figure out this issue (For computational research, not a... (4 Replies)
Discussion started by: Eblue562
4 Replies

6. Shell Programming and Scripting

Read column values from previous and next line using awk

Hi, I have a csv file which contains data that looks something like this: Key1 Key2 Key3 New_Key1 New_Key2 New_Key3 102 30 0 - - - 102 40 1 30 40 50 102 50 2 40 50 ... (4 Replies)
Discussion started by: Nishi_Licious
4 Replies

7. Shell Programming and Scripting

Remove previous line if next & previous lines have same 4th character.

I want to remove commands having no output. In below text file. bash-3.2$ cat abc_do_it.txt grpg10so>show trunk group all status grpg11so>show trunk group all status grpg12so>show trunk group all status GCPKNYAIGT73IMO 1440 1345 0 0 94 0 0 INSERVICE 93% 0%... (4 Replies)
Discussion started by: Raza Ali
4 Replies

8. Shell Programming and Scripting

Insert data in first column(if blank) from previous line first column

Dear Team I need to insert field(which is need to taken from previous line's first field) in first column if its blank. I had tried using sed but not find the way. Detail input and output file as below. Kindly help for same. INPUT: SCGR SC DEV DEV1 NUMDEV DCP ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

9. Shell Programming and Scripting

Fill data in column with previous value

Gents, Kindly help me. I have a file with empty values in selected column, I will like to fill the empty values with the previous value. Example Input file X 4959 30010 66727.00 20457.001 1 1441 66512.00 20234.00 20520.001 X 4959 30010 66727.00 20457.001 145 ... (7 Replies)
Discussion started by: jiam912
7 Replies

10. Shell Programming and Scripting

Fill column from previous row

Hi, I have the following content in file ABBR DESC COL3 COL4 COL5 COL6 AAA text desc aaa text text text text text text text text text text text text BBB text desc bbb text text text text text text text text CCC ... (10 Replies)
Discussion started by: bobbygsk
10 Replies
Gtk2::Editable(3pm)					User Contributed Perl Documentation				       Gtk2::Editable(3pm)

NAME
Gtk2::Editable - wrapper for GtkEditable HIERARCHY
Glib::Interface +----Gtk2::Editable METHODS
string = $editable->get_chars ($start_pos, $end_pos) o $start_pos (integer) o $end_pos (integer) $editable->copy_clipboard $editable->cut_clipboard $editable->delete_selection $editable->delete_text ($start_pos, $end_pos) o $start_pos (integer) o $end_pos (integer) boolean = $editable->get_editable $editable->set_editable ($is_editable) o $is_editable (boolean) new_position = $editable->insert_text (new_text, position) o $new_text (string) o ... (list) $editable->paste_clipboard integer = $editable->get_position $editable->set_position ($position) o $position (integer) $editable->select_region ($start, $end) o $start (integer) o $end (integer) (start, end) = $editable->get_selection_bounds Returns integers, start and end. SIGNALS
changed (Gtk2::Editable) insert-text (Gtk2::Editable, string, integer, gpointer) delete-text (Gtk2::Editable, integer, integer) The "insert-text" signal handler can optionally alter the text to be inserted. It may o Return no values for no change. Be sure to end with an empty "return". sub my_insert_text_handler { my ($widget, $text, $len, $pos, $userdata) = @_; print "inserting '$text' at char position '$pos' "; return; # no values } o Return two values "($text, $pos)" which are the new text and character position. sub my_insert_text_handler { my ($widget, $text, $len, $pos, $userdata) = @_; return (uc($text), $pos); # force to upper case } o Return no values and modify the text in $_[1] and/or position in $_[3]. For example, sub my_insert_text_handler { $_[1] = uc($_[1]); # force to upper case $_[3] = 0; # force position to the start return; # no values } Note that currently in a Perl subclass of a "Gtk2::Editable" widget, a class closure (ie. class default signal handler) for "insert-text" does not work this way. It instead sees the C level "($text, $len, $pos_pointer)", where $pos_pointer is a machine address and cannot be used easily. Hopefully this will change in the future. A "signal_chain_from_overridden" with the args as passed works, but for anything else the suggestion is to use a "signal_connect" instead. SEE ALSO
Gtk2, Glib::Interface COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::Editable(3pm)
All times are GMT -4. The time now is 06:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy