Sponsored Content
Top Forums Shell Programming and Scripting Finding a format in a file and replacing it Post 302623499 by Corona688 on Friday 13th of April 2012 06:26:21 PM
Old 04-13-2012
Is it always in the same column? That would make it a lot easier.

IOW, show a sample of your input data, not just a single cell of it.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

shellscript for finding and replacing in DG-UNIX

Newby here..... Is there any way of doing a find & replace within a huge file other than using something like : " vi - FileForReplacing < /u1/excel/consultants " contents of consultants file looks like :1,$s/0000031/CON/g :1,$s/0001032/JONES/g :1,$s/0001355/SMITH/g... (3 Replies)
Discussion started by: Gerry405
3 Replies

2. Solaris

finding & replacing blank rows/spaces in a file

Can anyone help me find and replace blank rows in a file with a numeric value (ie blankrow=someTxtOrNumValue), the file is over 500,000 rows long so it would need to be the quickest way as I'll need to do this for multiple files...I would be greatfull for any suggestions....thanks sample file:... (2 Replies)
Discussion started by: Gerry405
2 Replies

3. Shell Programming and Scripting

help with finding & replacing pattern in a file

Hi everyone. Could u be so kind and help me with on "simple" shell script? 1. i need to search a file line by line for a pattern. example of a lines in that file 2947 domain = feD,id = 00 0A 02 48 17 1E 1D 39 DE 00 0E 00,Name Values:snNo = f10 Add AttFlag = 0 2. i need to find... (0 Replies)
Discussion started by: dusoo
0 Replies

4. Shell Programming and Scripting

Need help in finding and replacing port numbers.

Hi All, I am trying to write a shell script which firstly will search some files and then increase the port numbers mentioned in them by a certain no. let me clear it with an example- suppose there r few files a,b,c,d.... file a's content- <serverEntries xmi:id="ServerEntry_1"... (3 Replies)
Discussion started by: ankushsingh10
3 Replies

5. Shell Programming and Scripting

Finding and replacing links

Hi, I would like to do a scripting for finding the links based on the name I have and replace the links with the new name. General find command lists everything for that links ( means all the sub-sirs and all the files), i need only the main link and replace. Can you anyone give me some... (1 Reply)
Discussion started by: rrb2009
1 Replies

6. Shell Programming and Scripting

Finding a String and Replacing it with an incremental value

Hi Friends, I have a text file which has about 200,000 records in it. we have a string which repeats in each and every record. So we have to write a script in ksh which finds that string on each line and replaces it with a new string(incremental value) for a set every four records. To be... (12 Replies)
Discussion started by: vpv0002
12 Replies

7. Homework & Coursework Questions

Finding/replacing text and redirection help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: What command would rename "sequentialInsert", in ~cs252/Assignments/commandsAsst/project/arrayops.h, to... (2 Replies)
Discussion started by: lothwen
2 Replies

8. Shell Programming and Scripting

Finding and replacing whole line using sed

Hi all, assume that i am having the following line in a file called file1. triumph and disaster must be treated same. I want to replace this line with. follow excellence success will chase you. is it possible to do this using sed. if possible kindly post me the... (2 Replies)
Discussion started by: anishkumarv
2 Replies

9. Shell Programming and Scripting

Finding/replacing strings in some files based on a file

Hi, We have a file (e.g. a .csv file, but could be any other format), with 2 columns: the old value and the new value. We need to modify all the files within the current directory (including subdirectories), so find and replace the contents found in the first column within the file, with the... (9 Replies)
Discussion started by: Talkabout
9 Replies

10. Shell Programming and Scripting

Finding the pattern and replacing the pattern inside the file

i have little challenge, help me out.i have a file where i have a value declared and and i have to replace the value when called. for example i have the value for abc and ccc. now i have to substitute the value of value abc and ccc in the place of them. Input File: go to &abc=ddd; if... (16 Replies)
Discussion started by: saaisiva
16 Replies
Gtk2::CellLayout(3)					User Contributed Perl Documentation				       Gtk2::CellLayout(3)

NAME
Gtk2::CellLayout SYNOPSIS
# This is an abstract interface; the CellLayout interface is # implemented by concrete classes like ComboBox and TreeViewColumn. # See the discussion for details on creating your own CellLayout. # This synopsis assumes you already have an instance in $cell_layout. # Add a cell renderer that shows the pixbuf in column 2 of the # associated TreeModel. It will take up only the necessary space # ("expand" => FALSE). my $cell = Gtk2::CellRendererPixbuf->new (); $cell_layout->pack_start ($cell, FALSE); $cell_layout->add_attribute ($cell, pixbuf => 2); # Add another cell renderer that gets the "text" property from # column 3 of the associated TreeModel, and takes up all remaining # horizontal space ("expand" => TRUE). my $cell = Gtk2::CellRendererText->new (); $cell_layout->pack_start ($cell, TRUE); $cell_layout->add_attribute ($cell, text => 3); DESCRIPTION
Gtk2::CellLayout is an interface to be implemented by all objects which want to provide a Gtk2::TreeViewColumn-like API for packing cells, setting attributes and data funcs. HIERARCHY
Glib::Interface +----Gtk2::CellLayout METHODS
$cell_layout->add_attribute ($cell, $attribute, $column) o $cell (Gtk2::CellRenderer) o $attribute (string) o $column (integer) Adds an attribute mapping to the list in $cell_layout. The $column is the column of the model from which to get a value, and the $attribute is the property of $cell to be set from the value. So, for example, if column 2 of the model contains strings, you could have the "text" attribute of a Gtk2::CellRendererText get its values from column 2. $cell_layout->set_attributes ($cell, ...) o $cell (Gtk2::CellRenderer) o ... (list) list of property name and column number pairs. Sets the pairs in the ... list as the attributes of $cell_layout, as with repeated calls to "add_attribute". All existing attributes are removed, and replaced with the new attributes. $cell_layout->set_cell_data_func ($cell, $func, $func_data=undef) o $cell (Gtk2::CellRenderer) o $func (scalar) o $func_data (scalar) Sets up $cell_layout to call $func to set up attributes of $cell, instead of the standard attribute mapping. $func may be undef to remove an older callback. $func will receive these parameters: $cell_layout The cell layout instance $cell The cell renderer to set up $model The tree model $iter TreeIter of the row for which to set the values $data The $func_data passed to "set_cell_data_func" list = $cell_layout->get_cells Fetch all of the cell renderers which have been added to $cell_layout. Since: gtk+ 2.12 $cell_layout->clear Unsets all the mappings on all renderers on $cell_layout and removes all renderers attached to it. $cell_layout->clear_attributes ($cell) o $cell (Gtk2::CellRenderer) Clears all existing attributes previously set with for $cell with "add_attribute" or "set_attributes". $cell_layout->pack_end ($cell, $expand) o $cell (Gtk2::CellRenderer) o $expand (boolean) Like "pack_start", but adds from the end of the layout instead of the beginning. $cell_layout->pack_start ($cell, $expand) o $cell (Gtk2::CellRenderer) o $expand (boolean) Packs $cell into the beginning of $cell_layout. If $expand is false, then $cell is allocated no more space than it needs. Any unused space is divided evenly between cells for which $expand is true. $cell_layout->reorder ($cell, $position) o $cell (Gtk2::CellRenderer) o $position (integer) Re-insert $cell at $position. $cell must already be packed into $cell_layout. CREATING A CUSTOM CELL LAYOUT
GTK+ provides several CellLayout implementations, such as Gtk2::TreeViewColumn and Gtk2::ComboBox. To create your own object that implements the CellLayout interface and therefore can be used to display CellRenderers, you need to add Gtk2::CellLayout to your class's "interfaces" list, like this: package MyLayout; use Gtk2; use Glib::Object::Subclass Gtk2::Widget::, interfaces => [ Gtk2::CellLayout:: ], ; This will cause perl to call several virtual methods with ALL_CAPS_NAMES when GTK+ attempts to perform certain actions. You simply provide (or override) those methods with perl code. The methods map rather directly to the object interface, so it should be easy to figure out what they should do. Those methods are: PACK_START ($cell_layout, $cell, $expand) PACK_END ($cell_layout, $cell, $expand) CLEAR ($cell_layout) ADD_ATTRIBUTE ($cell_layout, $cell, $attribute, $column) SET_CELL_DATA_FUNC ($cell_layout, $cell, $func, $data) CLEAR_ATTRIBUTES ($cell_layout, $cell) REORDER ($cell_layout, $cell, $position) list = GET_CELLS ($cell_layout) SEE ALSO
Gtk2, Glib::Interface COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.12.1 2010-07-05 Gtk2::CellLayout(3)
All times are GMT -4. The time now is 03:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy