Sponsored Content
Top Forums Shell Programming and Scripting Selecting section and removing match Post 303043837 by RudiC on Friday 7th of February 2020 07:30:03 PM
Old 02-07-2020
Try - remember you wanted a space! -

Code:
$ awk '/inlineifset/ {sub (/@inlineifset{mrg, @opar{@bullet{}/, " "); print}' RS= ORS="\n\n" file
  @subsubsection ObsPy LibmSeed License Problem,,,,}}

@inlineifset{mrg, @opar{@point{} ObsPy [LibmSeed];, Problems Merging
Codes;, Hard to package and release software;, Practices in Seismology
require careful thought,}}

@inlineifset{mrg, @opar{@point{} ObsPy [LibmSeed];, Problems Merging
Codes;, Hard to package and release software;, Practices in Seismology
require careful thought,}}

@inlineifset{mrg, @opar{+ ObsPy LibmSeed Routines;, libmseed-2.6.2:
obspy-readbuffer.c packdata.c unpackdata.c;, Pack Routines taken from
qlib2;, Incompatible Licenses.,}}

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing Duplicate Lines per Section

Hello, I am in need of removing duplicate lines from within a file per section. File: ABC1 012345 header ABC2 7890-000 ABC3 012345 Header Table ABC4 ABC5 593.0000 587.4800 ABC5 593.5000 587.6580 <= dup need to remove ABC5 593.5000 ... (5 Replies)
Discussion started by: petersf
5 Replies

2. Shell Programming and Scripting

Selecting A Section of A File Based On the Time Within It

Hi, I have a file formated like this: John 7.22 2010-01-25_17:01:36 George 8.22 2010-01-25_17:02:36 Bob 9.62 2010-01-25_17:04:36 Jane 10.11 2010-01-25_17:05:36 Emma 4.52 2010-01-25_17:01:36 What I want to do is cut out only the entries that have... (2 Replies)
Discussion started by: Donkey25
2 Replies

3. Shell Programming and Scripting

Removing file lines that each match to a different patterns

I have a very large file (10,000,000 lines), that contains a sample id and a property of that sample. I have another file that contains around 1,000,000 lines with sample ids that I want to remove from the original file (create a new file without these lines). I know how to do this in Perl, but it... (9 Replies)
Discussion started by: Jo_puzzled
9 Replies

4. Shell Programming and Scripting

Extract section of file based on word in section

I have a list of Servers in no particular order as follows: virtualMachines="IIBSBS IIBVICDMS01 IIBVICMA01"And I am generating some output from a pre-existing script that gives me the following (this is a sample output selection). 9/17/2010 8:00:05 PM: Normal backup using VDRBACKUPS... (2 Replies)
Discussion started by: jelloir
2 Replies

5. UNIX for Dummies Questions & Answers

Removing duplicate rows & selecting only latest date

Gurus, From a file I need to remove duplicate rows based on the first column data but also we need to consider a date column where we need to keep the latest date (13th column). Ex: Input File: Output File: I know how to take out the duplicates but I couldn't figure out... (5 Replies)
Discussion started by: shash
5 Replies

6. Shell Programming and Scripting

Selecting nearest pattern match

I'm looking to match an error code against a list of possible codes and get the nearest match. The code would be a 6 character hexadecimal string. I have a file of error codes all of which have a specific first 3 characters, however, after that the last 3 characters may be specific or generic as... (3 Replies)
Discussion started by: dazedandconfuse
3 Replies

7. Shell Programming and Scripting

Perl removing line match with pattern in column

Hi, I have log like this: ... (1 Reply)
Discussion started by: justbow
1 Replies

8. Shell Programming and Scripting

Removing section from tnsnames.ora

Hi, I am trying to write a script or command to remove a section from tnsnames.ora file in the following example I would like to remove tns_alias2 section $ cat tnsnames.ora tns_alias1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host1 )(PORT = 1521)) ... (3 Replies)
Discussion started by: ynixon
3 Replies

9. Shell Programming and Scripting

Comparing two one-line files and selecting what does not match

I have two files. One is consisting of one line, with data separated by spaces and each number appearing only once. The other is consisting of one column and multiple lines which can have some numbers appearing more than once. It looks something like this: file 1: 20 700 15 30 file2: 10... (10 Replies)
Discussion started by: maya3
10 Replies

10. Shell Programming and Scripting

Selecting text on multiple lines, then removing a beginning and end patterns

I have a file similar to the below. I am selecting only the paragraphs with @inlineifset. I am using the following command sed '/@inlineifset/,/^ *$/!d; s/@inlineifset{mrg, @btpar{@//' $flnm >> $ofln This produces @section Correlations between seismograms,,,,}} ... (5 Replies)
Discussion started by: Danette
5 Replies
mcs(1)								   User Commands							    mcs(1)

NAME
mcs - manipulate the comment section of an object file SYNOPSIS
mcs [-cdpVz] [-a string] [-n name] file... DESCRIPTION
The mcs command is used to manipulate a section, by default the .comment section, in an ELF object file. It is used to add to, delete, print, and compress the contents of a section in an ELF object file, and print only the contents of a section in a COFF object file. mcs cannot add, delete, or compress the contents of a section that is contained within a segment. If the input file is an archive (see ar.h(3HEAD)), the archive is treated as a set of individual files. For example, if the -a option is specified, the string is appended to the comment section of each ELF object file in the archive; if the archive member is not an ELF object file, then it is left unchanged. mcs must be given one or more of the options described below. It applies, in order, each of the specified options to each file. OPTIONS
The following options are supported: -a string Appends string to the comment section of the ELF object files. If string contains embedded blanks, it must be enclosed in quotation marks. -c Compresses the contents of the comment section of the ELF object files. All duplicate entries are removed. The ordering of the remaining entries is not disturbed. -d Deletes the contents of the comment section from the ELF object files. The section header for the comment section is also removed. -n name Specifies the name of the comment section to access if other than .comment. By default, mcs deals with the section named .comment. This option can be used to specify another section. mcs can take multiple -n options to allow for specification of multiple section comments. -p Prints the contents of the comment section on the standard output. Each section printed is tagged by the name of the file from which it was extracted, using the format file[member_name]: for archive files and file: for other files. -V Prints on standard error the version number of mcs. -z Replaces any SHT_PROGBITS sections with zeros while retaining the original attributes of the sections. EXAMPLES
Example 1: Printing a file's comment section The following entry example% mcs -p elf.file prints the comment section of the file elf.file. Example 2: Appending a string to a comment section The following entry example% mcs -a xyz elf.file appends string xyz to elf.file's comment section. FILES
/tmp/mcs* temporary files ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbtool | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ SEE ALSO
ar(1), as(1), ld(1), ar.h(3HEAD), elf(3ELF), tmpnam(3C), a.out(4), attributes(5) NOTES
When mcs deletes a section using the -d option, it tries to bind together sections of type SHT_REL and target sections pointed to by the sh_info section header field. If one is to be deleted, mcs attempts to delete the other of the pair. By using the -z option, it is possible to make an object file by removing the contents of SHT_PROGBITS sections while retaining the object file's original structure as an ELF file. The need for use of the -z option is limited. However, the option can be used to deliver an object file when the contents of SHT_PROGBITS sections are not relevant. SunOS 5.10 1 Apr 2004 mcs(1)
All times are GMT -4. The time now is 04:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy