Sponsored Content
Top Forums Shell Programming and Scripting hot to specify the last column in sed? Post 302207775 by fpmurphy on Friday 20th of June 2008 08:50:44 PM
Old 06-20-2008
This is very specific to the sample text provided and assumes that word boundary support, i.e. \b or \<, is not available in your version of sed.
Code:
$ sed -e 's/ aa$/ ++/' -e 's/aaa/+++/g' -e 's/aa/YY/g' -e 's/++/aa/' -e 's/+++/aaa/g' file
YY YY YY YY aa
c b c d YY a
e f ff mm aaa aaa 123
$

 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Hot Keys

I am a new user, using Unix in a DOS window. Can I set up Hot Keys to run a script? Example - A12.1.13.15 aaaaBbbbCccc Thank you, cwtlr (8 Replies)
Discussion started by: cwtlr
8 Replies

2. What is on Your Mind?

Too Hot Here

Officially, we had high of 96°F with a relative humidity of 52% here in Rockville Md today. But my car's thermometer said the outside temp was 110° when I first got in this afternoon. After driving for 30 minutes it cooled down to 103°. I actually have a nasty burn on my hand just from leaning... (19 Replies)
Discussion started by: Perderabo
19 Replies

3. Shell Programming and Scripting

awk/sed column replace using column header - help

$ cat log.txt Name Age Sex Lcation nfld alias xsd CC 25 M XYZ asx KK Y BB 21 F XAS awe SS N SD 21 M AQW rty SD A How can I replace the column with header "Lcation" with the column with header "alias" and delete the "alias" column? so that the final output will become: Name Age Sex... (10 Replies)
Discussion started by: jkl_jkl
10 Replies

4. Shell Programming and Scripting

Awk or Sed, fubd match in column, then edit column.

FILE A: 9780743551526,(Abridged) 9780743551779,(Unabridged) 9780743582469,(Abridged) 9780743582483,(Unabridged) 9780743563468,(Abridged) 9780743563475,(Unabridged) FILE B: c3saCandyland 9780743518321 "CANDYLAND" "MCBAIN, ED" 2001 c3sbCandyland 9780743518321 ... (7 Replies)
Discussion started by: glev2005
7 Replies

5. Shell Programming and Scripting

awk or sed: change the color of a column w/o screwing up column spacing

Hey folks. I wrote a little awk script that summarizes /proc/net/dev info and then pipes it to the nix column command to set up column spacing appropriately. Here's some example output: Iface RxMBytes RxPackets RxErrs RxDrop TxMBytes TxPackets TxErrs TxDrop bond0 9 83830... (3 Replies)
Discussion started by: ryran
3 Replies

6. Shell Programming and Scripting

Solution for replacement of 4th column with 3rd column in a file using awk/sed preserving delimters

input "A","B","C,D","E","F" "S","T","U,V","W","X" "AA","BB","CC,DD","EEEE","FFF" required output: "A","B","C,D","C,D","F" "S", T","U,V","U,V","X" "AA","BB","CC,DD","CC,DD","FFF" tried using awk but double quotes not preserving for every field. any help to solve this is much... (5 Replies)
Discussion started by: khblts
5 Replies

7. UNIX for Beginners Questions & Answers

Awk/sed summation of one column based on some entry in first column

Hi All , I am having an input file as stated below Input file 6 ddk/djhdj/djhdj/Q 10 0.5 dhd/jdjd.djd.nd/QB 01 0.5 hdhd/jd/jd/jdj/Q 10 0.5 512 hd/hdh/gdh/Q 01 0.5 jdjd/jd/ud/j/QB 10 0.5 HD/jsj/djd/Q 01 0.5 71 hdh/jjd/dj/jd/Q 10 0.5 ... (5 Replies)
Discussion started by: kshitij
5 Replies
XNEUR(1)						      General Commands Manual							  XNEUR(1)

NAME
XNeur - in-place conversion of text typed in with a wrong keyboard layout SYNOPSIS
xneur [options] DESCRIPTION
When users work in multilingual environment (e.g. Russian+English), they sometimes type in text with wrong keyboard layout. In auto mode XNeur can automatically detect language of word user typed, switch keyboard layout and convert word from one keyboard layout into another. In manual mode user has ability to convert last typed word or some selected text with hot-keys. The main idea of this utility is similar to Punto Switcher for MS Windows. For now XNeur support Armenian, Belarusian, Bulgarian, Czech, Georgian, German, Greek, English, Estonian, French, Kazakh, Lithuanian, Latvian, Poland, Romanian, Russian, Spanish, Ukrainian and Uzbek languages. And more in future... OPTIONS
-v, --version Print version and exit. -h, --help Print short help. -a, --about About for XNeur. -f, --force Skip check for other instances of XNeur runned. -g, --generate Generate proto and proto3 files from layout and sample text files. This option for developers only! SEE ALSO
gxneur(1), kxneur(1) AUTHOR
Andrew Crew Kuznetsov, Nikolay Yankin XNEUR(1)
All times are GMT -4. The time now is 09:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy