Sponsored Content
Full Discussion: sed append words
Top Forums Shell Programming and Scripting sed append words Post 302455771 by kurumi on Wednesday 22nd of September 2010 11:11:36 AM
Old 09-22-2010
Code:
$ ruby -ane '$F[1]=$F[1]+"_label";puts $F.join(" ")' file
$ awk '{$2=$2"_label"}1' file

This User Gave Thanks to kurumi For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed [delete everything between two words]

Hi, I have the following codes below that aims to delete every words between two pattern word. Say I have the files To delete every word between WISH_LIST=" and " I used the below codes (but its not working): #!/bin/sh sed ' /WISH_LIST=\"/ { N /\n.*\"/ {... (3 Replies)
Discussion started by: Orbix
3 Replies

2. Shell Programming and Scripting

How to append words at the end of first line

Hi Unix gurus This is my first post here. I have a file which looks like this: string1,string2 ,string3 ,string4 ... ... I need to append all words below first line to the first line, ie string1,string2,string3,string4,... Bear in mind that it is not known how many lines follow... (11 Replies)
Discussion started by: lmatlebyane
11 Replies

3. Shell Programming and Scripting

search two words in sed

I've following sed command working fine - sed '/search_pattern1/ !s/pattern1/pattern2/" file Now, I want to search two patterns - search_pattern1 and search_pattern2 . How can put these into above sed statement ? Thanks in advance. (12 Replies)
Discussion started by: ajitkumar2
12 Replies

4. Shell Programming and Scripting

How to append using sed

Hello all, I want to use sed to append a variable stored in $i, how do i do that? $i contains a path to a directory and i want to append it before the result i get from awk statement, before affecting awk results. rite now out put i get from code below is:- The path is:... (2 Replies)
Discussion started by: asirohi
2 Replies

5. Shell Programming and Scripting

SED - delete words between two possible words

Hi all, I want to make an script using sed that removes everything between 'begin' (including the line that has it) and 'end1' or 'end2', not removing this line. Let me paste an 2 examples: anything before any string begin few lines of content end1 anything after anything before any... (4 Replies)
Discussion started by: meuser
4 Replies

6. Shell Programming and Scripting

How to search and append words in a file

Hi , I have a file myhost.txt which contains below, 127.0.0.1 localhost 1.17.1.5 atrpx958 11.17.10.11 atrpx958zone nsybhost I need to append words only after "atrpx958" like 'myhost' and 'libhost' and not after atrpx958zone. How to search the word atrpx958 only in... (2 Replies)
Discussion started by: gsreeni
2 Replies

7. Shell Programming and Scripting

How to search and append words in the same file using unix scripting file operations

Hi , I have a file myhost.txt which contains below, 127.0.0.1 localhost 1.17.1.5 atrpx958 11.17.10.11 atrpx958zone nsybhost I need to append words only after "atrpx958" like 'myhost' and 'libhost' and not after atrpx958zone. How to search the word atrpx958(which is hostname) only,... (5 Replies)
Discussion started by: gsreeni
5 Replies

8. Shell Programming and Scripting

Swap words using sed

Hi. I have to swap the first and the third word in all lines of a txt file using sed. Separators between words are: any charachter, except intervall. I hope, you'll understand what I want to do. my english is not so good, sorry for that:) (10 Replies)
Discussion started by: T720
10 Replies

9. Shell Programming and Scripting

Append variable value with sed

I have a requirement where I need to add a variable value based on a pattern match. When I try this it works: sed '/IS_ETL_DEV/a\ ABCD' File1.txt > File1.tmp Now I want to replace IS _ETL_DEV with a variable like $Pattern and replace the values ABCD with a variable $Var the value "$$XYZ=1".... (4 Replies)
Discussion started by: vskr72
4 Replies

10. Shell Programming and Scripting

Reverse words with sed

Hi guys, I'm wondering what the best way would be to reverse words in a string based on certain characters. For example: echo Word1Word2Word3Word4 | sed ' /\n/ !G s/\(Word.\)\(.*\n\)/&\2\1/ //D ' This returns: Word4Word3Word2Word1 I'm no sed expert but... (2 Replies)
Discussion started by: Subbeh
2 Replies
UControl(3U)						    InterViews Reference Manual 					      UControl(3U)

NAME
UControl, UControlInteractor - base classes for menu and button interfaces that work with ControlInfo objects SYNOPSIS
#include <Unidraw/uctrl.h> DESCRIPTION
UControl is an abstract class that augments InterViews' Control base class to deal with Unidraw's ControlInfo objects, which define a key- board equivalent for the control. UControlInteractor is an abstract base class for interactors that base their appearance on the informa- tion in a ControlInfo object. UControl subclasses can use UControlInteractor subclasses to define their appearance. Unidraw-based applications needn't use UControls and UControlInteractors to help define their look and feel if Unidraw's keyboard equiva- lent mechanism is not needed. UCONTROL PUBLIC OPERATIONS
virtual void SetControlInfo(ControlInfo*) ControlInfo* GetControlInfo() Assign and retrieve the UControl's ControlInfo object. UCONTROL PROTECTED OPERATIONS
UControl(ControlInfo*) UControl(const char*, ControlInfo*) UControl provides protected constructors that let subclasses initialize the ControlInfo object and optionally specify their instance name. UCONTROLINTERACTOR PUBLIC OPERATIONS
virtual void SetControlInfo(ControlInfo*) ControlInfo* GetControlInfo() Assign and retrieve the UControlInteractor's ControlInfo object. virtual void Highlight(boolean) The UControlInteractor's appearance is defined by a Graphic object, which it builds from information in its ControlInfo object. By default, UControlInteractor highlights itself by drawing this graphic with its foreground and background colors reversed. UCONTROLINTERACTOR PROTECTED OPERATIONS
UControlInteractor(ControlInfo*) UControlInteractor() UControlInteractor defines two protected constructors. One takes the ControlInfo object to use as an argument. This constructor also initializes the UControlInteractor's _label protected member by calling InitLabel (described below) with the ControlInfo object. The parameterless constructor initializes _label to nil. Both constructors initialize the UControlInteractor's _picture protected member to point to an instance of a Picture object, which defines the UControlInteractor's appearance. virtual void Invert() Invert reverses _picture's colors without drawing it. Graphic* InitLabel(ControlInfo*) Create a graphic from the information stored in a ControlInfo object that defines the UControlInteractor's appearance. This opera- tion creates a GraphicView of the ControlInfo's GraphicComp and returns a copy of the view's graphic. SEE ALSO
Control(3I), ControlInfo(3U), Graphic(3U), GraphicComp(3U), GraphicView(3U), KeyMap(3U) Unidraw 20 November 1990 UControl(3U)
All times are GMT -4. The time now is 04:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy