Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Mac OS X sed, add newline after pattern Post 302819733 by RudiC on Tuesday 11th of June 2013 10:34:42 AM
Old 06-11-2013
Pls. post input and desired output files, show the tools you used/want to use, and explain the logics to be applied.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep and sed to find a pattern and add newline

Hello All, I have log file the result from a multithreaded process. So when a process finishes it will write to this log file as 123 rows merged. The issue is sometimes the processess finish at the same time or write to the file at the same time as 123 rows merged.145 rows merged. At... (5 Replies)
Discussion started by: ssikhar
5 Replies

2. Shell Programming and Scripting

grep the pattern followed by newline

Hi I have a problem using grep to find a pattern followed by newline. Here is my file xxxxxxxxxxxpattern patternxxxxxx pattern xxxpattern xxpatternx xxxxxxyyyyxxxx I want the result to be like this xxxxxxxxxxxpattern pattern xxxpattern Please help (2 Replies)
Discussion started by: lalelle
2 Replies

3. Shell Programming and Scripting

SED: how to remove newline after pattern?

Hi, I have the following XML not well-indented code: <hallo >this is a line </hallo> So I need to remove the newline. This syntax finds what I need to correct, but I don't know how to remove the newline after my pattern: sed 's/<.*$/&/' How can I subtract the newline after my... (1 Reply)
Discussion started by: nico.ben
1 Replies

4. Shell Programming and Scripting

Sed: add text if pattern not found

Hello, I would like to add the line TIMEZONE="CET" if the pattern TIMEZONE is not found between the range <JOB and JOB> : Example: Src file: <!DOCTYPE DEFTABLE SYSTEM "deftable.dtd"> <DEFTABLE > <JOB TASKTYPE="Job" TIMEFROM="0030" TIMEZONE="CET" </JOB> <JOB... (5 Replies)
Discussion started by: mutunzi
5 Replies

5. Shell Programming and Scripting

Insert two newline after some pattern

Hi, I need to insert two newline characters after matching of a pattern in each line of a file. Eg. If i have a file with contents as follows:- Now, i want output as follows :- i.e., I need to insert two newline characters after the occurance of pattern "</Message>>". Thnx... (1 Reply)
Discussion started by: DTechBuddy
1 Replies

6. Shell Programming and Scripting

[Solved] Find duplicate and add pattern in sed/awk

<Update> I have the solution: sed 's/\{3\}/&;&;---;4/' The thread can be marked as solved! </Update> Hi There, I'm working on a script processing some data from a website into cvs format. There is only one final problem left I can't find a solution. I've processed my file... (0 Replies)
Discussion started by: lolworlds
0 Replies

7. Shell Programming and Scripting

Insert new pattern in newline after the nth occurrence of a line pattern - Bash in Ubuntu 12.04

Hi, I am getting crazy after days on looking at it: Bash in Ubuntu 12.04.1 I want to do this: pattern="system /path1/file1 file1" new_pattern=" data /path2/file2 file2" file to edit: data.db - I need to search in the file data.db for the nth occurrence of pattern - pattern must... (14 Replies)
Discussion started by: Phil3759
14 Replies

8. Shell Programming and Scripting

sed to add word if pattern exists

Hi, I have a file with data listed below: clm_id double, cnl_id double, cnl_amt double I want output to be clm_id string, cnl_id string, cnl_amt double So replace double by string if the field contains the word _id I tried sed -e 's/_id/& string/' filename The above will not... (2 Replies)
Discussion started by: wahi80
2 Replies

9. Shell Programming and Scripting

sed to remove newline chars based on pattern mis-match

Greetings Experts, I am in AIX; I have a file generated through awk after processing the input files. Now I need to replace or remove the new-line characters on all lines that doesn't have a ; which is the last character on the line. I tried to use sed 's/\n/ /g' After checking through the... (6 Replies)
Discussion started by: chill3chee
6 Replies

10. Shell Programming and Scripting

sed and awk to find pattern and add priffix

Original File Server1|poweredOn|268401| Server1/Server1.vmx|Red Hat Enterprise Linux 5 (64-bit) Need Output Server1|poweredOn|DR|T1|268401| Server1/Server1.vmx|Red Hat Enterprise Linux 5 (64-bit) Conduction to check find the string "SFCHT1" and "SR" and add prefix has... (4 Replies)
Discussion started by: ranjancom2000
4 Replies
MONA(1) 							    BRICS tools 							   MONA(1)

NAME
mona - a decision procedure for the logics WS1S and WS2S SYNOPSIS
mona [ options ] mona-file DESCRIPTION
MONA is a tool that translates formulas in the logics WS1S or WS2S into finite-state automata represented by BDDs. The formulas may express search patterns, temporal properties of reactive systems, parse tree constraints, etc. MONA also analyses the automaton resulting from the compilation, and determines whether the formula is valid and, if the formula is not valid, generates a counter-example. The MONA project is a research project at the BRICS Research Center at University of Aarhus, Denmark. Full documentation, GPL source code, and related research papers are available from the MONA project home page at http://www.brics.dk/mona OPTIONS
-w Output whole automaton. Default is to only output its size. -n Don't analyze automaton. Default is to analyze for validity and unsatisfiability and to generate a satisfying example and counter- example. -t Print elapsed time for each phase. If -s is also used, the time for each automaton operation is also printed. -s Print statistics. Prints information for each automaton operation and a summary. -i Print intermediate automata (implies -s). -d Dump AST, symboltable, and code DAG. Useful for debugging. -q Quiet, don't print progress. -e Enable separate compilation. (See the MONALIB environment variable below.) -oN Code optimization level N (0=none, 1=safe, 2=heuristic) (default 1). -r Disable BDD index reordering, use order of declaration as index ordering. Default is to reorder BDD indices heuristically. -f Force normal tree-mode output style. Only applicable for WSRT mode. -m Alternative M2L-Str emulation (v1.3 style). -h Enable inherited acceptance analysis. -u Unrestrict output automata. Create conventional automata by converting "don't-care" states to "reject" states and minimizes. -gw Output whole automaton in Graphviz format (implies -n -q). (Graphviz is available at http://www.research.att.com/sw/tools/graphviz/) -gs Output satisfying example tree in Graphviz format (implies -q). -gc Output counter-example tree in Graphviz format (implies -q). -gd Dump code DAG in Graphviz format (implies -n -q). -xw Output whole automaton in external format (implies -n -q). "External format" is the format used by dfalib and gtalib, see the source package. ENVIRONMENT
MONALIB Defines the directory used for separate-compilation automata (default is current directory). BUGS
Please send bug reports to <mona@brics.dk> AUTHORS
Anders Moeller <amoeller@brics.dk>, Nils Klarlund, Jacob Elgaard, Theis Rauhe, and Morten Biehl. FEBRUARY 2008 MONA(1)
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy