sed , awk script for printing matched line before regular expression
hi All ,
I am having a large file with lots of modules as shown below
###############################################
################################################
I need to match Ring regular expression and script should print corresponding module related to that "Ring" expression ...Ring lies in different modules ...
Output file
#################################
I am using this one liner
but it is priting one line above the Ring expression ...
I need to find out the corresponding module of the Ring where it lies and create a output file
Please help me out
Last edited by Don Cragun; 05-07-2014 at 05:14 PM..
Reason: Add CODE tags.
I have the following text format in a file which lists the question first and then 5 choices
after that the explanantion and finally the answer.
1.The amount of time it takes for most of a worker’s occupational knowledge and skills to become
obsolete has been declining because of the... (2 Replies)
Hey, I found a way to print the lines which is just before a regular expression, not including the expression.
sed -n '/regexp/{n;p;}' myfile
Now I'm looking for a way to print all lines, exept the regular expression and also the line before the same regular expression.
Use code tags. (1 Reply)
Hi ,
I am having an issue with the Awk script to insert newline for a regular expression match
Having a file like this
FILE1
####################
RXOER , RXERA , RXERC , RXERD
.RXEA(RXBSN), RXERD , REXCD
input RXEGT
buffer RXETRY
#######################
Want to match the RXE... (38 Replies)
Hi,
I read the book of <<unix shell programming>>. The regular expression ^\(.\)\1 matches the first character on the line and stores it in register 1. Then the expression matches whatever is stored in the register 1, as specified by the \1. The net effect of this regular expression is to match... (2 Replies)
Hello:
(exp) : match "exp",the matched text is stored in auto named arrays.
How can I get the matched text ? What is the name of the auto named arrays on linux shell ? (4 Replies)
Hi all,
How am I read a file, find the match regular expression and overwrite to the same files.
open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat";
open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat";
while (<DESTINATION_FILE>)
{
# print... (1 Reply)
Hello All,
I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)
j=0
while } ]
do
k=`expr $j + 1`
sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt
---some operation goes... (11 Replies)
I thought this would be easy to Google, but I am having trouble getting a clean result that I can understand.
I simply want to insert the the line:
My Network 192.168.1.1
After the last line that begins with ACL localnet (15 Replies)
I've found this script which seems very promising to solve my issue:
To search and replace many different database passwords in many different (.php, .pl, .cgi, etc.) files across my filesystem.
The passwords may or may not be contained within quotes, single quotes, etc.
#!/bin/bash... (4 Replies)
Discussion started by: spacegoose
4 Replies
LEARN ABOUT DEBIAN
scitools
SCITOOLS(1) General Commands Manual SCITOOLS(1)NAME
scitools - run a SciTools command
SYNOPSIS
scitools command [OPTIONS]
DESCRIPTION
The scitools script takes a command and runs a corresponding utility. The available commands are listed below.
file2interactive
Utility for taking a set of Python statements in a file and creating the corresponding interactive Python shell session.
floatdiff
Script for examining differences in regression tests involving floating-point numbers. Used in [1].
regression
Simple front-end script to SciTools' Regression module. Used in [1].
ps2mpeg
Utility for turning a set of PostScript files into an MPEG movie, using mpeg_encode or ppmtompeg.
profiler
Script for simplifying the execution of Python's profiling tools. Used in [1].
rename Script for renaming a set of files by substituting one string or regular expression with another.
subst Script for subsituting a phrase by another in a set of files. Accepts regular expressions. Treated in [1].
replace
Script for subsituting a phrase by another in a set of files. Does not use regular expressions, just plain text (well suited for
substituting text with much use of backslashes, curly braces, and other special characters in regular expressions (e.g., LaTeX
text).
movie Script for creating a movie file from a sequence of image files (frames). By default an HTML file for displaying the image (PNG)
files are made.
pyreport
Processes a Python script and pretty prints the results using LateX. If the script uses show() commands (from scitools.easyviz) they
are caught by pyreport and the resulting graphs are inserted in the output pdf. Comments lines starting with "#!" are interpreted as
rst lines and pretty printed accordingly in the pdf.
[1] H. P. Langtangen: Python Scripting for Computational Science. Third
edition, second printing. Springer, 2009.
OPTIONS -h, --help
Show usage for all commands and exit.
BUGS
Send comments, questions, bug reports etc. to scitools@googlegroups.com.
LICENSE
SciTools is licensed under the new BSD license.
AUTHOR
SciTools is written by Hans Petter Langtangen <hpl@simula.no>, Johannes Ring <johannr@simula.no>, Ilmar Wilbers <ilmarw@simula.no>, and
Rolv E. Bredesen <rolv@simula.no>. This manual page is written by Johannes Ring <johannr@simula.no>.
SCITOOLS(1)