Sponsored Content
Top Forums UNIX for Advanced & Expert Users sed REGEX to print multiple occurrences of a pattern from a line Post 302952627 by RudiC on Thursday 20th of August 2015 12:39:26 PM
Old 08-20-2015
Try
Code:
sed 's/^[^c]*\(call\)/\1/;s/ \(call\)/\n\1/g;s/\(origin=[^ ]*\)[^\n]*/\1/g' file
call=1 origin=AAAA
call=3 origin=BBBB
call=5 origin=CCCC
call=2 origin=DDDD
call=4 origin=EEEE

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed replace multiple occurrences on the same line, but not all

Hi there! I am really enjoying working with sed. I am trying to come up with a sed command to replace some occurrences (not all) in the same line, for instance: I have a command which the output will be: 200.300.400.5 0A 0B 0C 01 02 03 being that the last 6 strings are actually one... (7 Replies)
Discussion started by: ppucci
7 Replies

2. Shell Programming and Scripting

CSV: Replacing multiple occurrences inside a pattern

Greatings all, I am coming to seek your knowledge and some help on an issue I can not currently get over. I have been searching the boards but did not find anything close to this matter I am struggling with. I am trying to clean a CSV file and make it loadable for my SQL*Loader. My problem... (1 Reply)
Discussion started by: OCanada
1 Replies

3. Shell Programming and Scripting

Sed print range of lines between line number and pattern

Hi, I have a file as below This is the line one This is the line two <\XMLTAG> This is the line three This is the line four <\XMLTAG> Output of the SED command need to be as below. This is the line one This is the line two <\XMLTAG> Please do the need to needful to... (4 Replies)
Discussion started by: RMN
4 Replies

4. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies

5. Shell Programming and Scripting

Multiple pattern match and print the output in a single line

I need to match two patterns in a log file and need to get the next line of the one of the pattern (out of two patterns) that is matched, finally need to print these three values in a single line. Sample Log: 2013/06/11 14:29:04 <0999> (725102) Processing batch 02_1231324 2013/06/11... (4 Replies)
Discussion started by: rpm120
4 Replies

6. Shell Programming and Scripting

Print occurrences for pattern match

Hi All, I want to print all the occurrences for a particular pattern from a file. The catch is that the pattern search is partial and if any word in the file contains the pattern, that complete word has to be printed. If there are multiple words matching the pattern on a specific line, then all... (2 Replies)
Discussion started by: decci_7
2 Replies

7. Shell Programming and Scripting

Regex: print matched line and exact pattern match

Hi experts, I have a file with regexes which is used for automatic searches on several files (40+ GB). To do some postprocessing with the grep result I need the matching line as well as the match itself. I know that the latter could be achieved with grep's -o option. But I'm not aware of a... (2 Replies)
Discussion started by: stresing
2 Replies

8. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies

9. Shell Programming and Scripting

How to print previous line of multiple pattern matched line?

Hello, I have below format log file, Comparing csv_converted_files/2201/9747.1012H67126.5077292103609547345.csv and csv_converted_files/22019/97447.1012H67126.5077292103609547345.csv Comparing csv_converted_files/2559/9447.1012H67126.5077292103609547345.csv and... (6 Replies)
Discussion started by: arvindshukla81
6 Replies

10. Shell Programming and Scripting

Delete multiple occurrences of the same pattern on a line but the first

The lines that I am trying to format look like Device ID: j01-01, IP address: 10.10.10.36, IP address: 10.10.10.35, IP address: 10.10.102.201, Platform: 8040, Capabilities: Host , Interface: GigabitEthernet9/45, Port ID (outgoing port): e0k,Here is what I have so far but it... (4 Replies)
Discussion started by: dis0wned
4 Replies
RDF2BIN(1)							   Debian Manual							RDF2BIN(1)

NAME
rdf2bin, rdf2com - convert an RDOFF object file to flat binary SYNOPSIS
rdf2bin [-o relocation-origin] [-p segment-alignment] [-f format] input-file output-file rdf2com [-p segment-alignment] input-file output-file rdf2ith [-o relocation-origin] [-p segment-alignment] input-file output-file rdf2srec [-o relocation-origin] [-p segment-alignment] input-file output-file OPTIONS
-o relocation-origin Relocate at origin relocation-origin. If invoked as rdf2com, the default relocation origin will be 0x100. Else, the default origin is 0. -p segment-alignment Pad segments until their size is a multiple of segment-alignment. By default, 16 is used. -f format Specify the output format. The currently supported formats are binary (bin), DOS COM (binary with origin 0x100) (com) Intel hex (ith or ihx), and Motorola S-Records (srec). If not specified, the format is set by the command name. AUTHORS
Julian Hall <jules@earthcorp.com>, H. Peter Anvin <hpa@zytor.com>. This manual page was written by Matej Vela <vela@debian.org>. BUGS
This utility currently only supports the classic segments .text, .data and .bss. Debian Project September 6, 1999 RDF2BIN(1)
All times are GMT -4. The time now is 07:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy