07-15-2016
Thanks!
Can you elaborate your script, please?
Last edited by yifangt; 07-15-2016 at 02:50 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
the data file is as below:
> cat master.cnf
/usr| location for usr|5
/src/ver1| version 1 |10
/src/ver2/log| ver 2 log |25
/src/sys/apps/log| Application log for sys|36
/src/sys/apps/conf| configuration location for app|45
/src/sys/apps/bin| binary location app|55my script is as below:
... (1 Reply)
Discussion started by: McLan
1 Replies
2. UNIX for Dummies Questions & Answers
Good Day,
Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp.
sed -n '/regexp/{n;p;}' filename
What if my regexp is 3 word or a sentence. Im... (3 Replies)
Discussion started by: ownins
3 Replies
3. Shell Programming and Scripting
Problem:
GIVEN
=======
my $sql="INSERT INTO table_nm(a, b, b, d, e, f , g) VALUES (2046, TODAY, 'Change Subscription Name', '00000000000002000000000000000000000000000000000000', '00000000000001000000000000000000000000000000000000', '00000000000000000000000000000000000000000000000000', 1);... (2 Replies)
Discussion started by: Niroj
2 Replies
4. Shell Programming and Scripting
Hi,
I know how to use awk to search some expressions like five consecutive numbers, , this is easy.
However, how do I make awk print the pattern that is been matched?
For example:
input: usa,canada99292,japan222,france59664,egypt223
output:99292,59664 (6 Replies)
Discussion started by: grossgermany
6 Replies
5. Shell Programming and Scripting
Hi users
I have one file which has number of occurrence of one pattern
examples
Adjustmenttype,11
xyz 10
dwe 9
abd 13
def 14
Adjustmenttype,11
xyz 24
dwe 34
abd 35
def 11
nmb 12
Adjustmenttype, not eleven
....
...
... (2 Replies)
Discussion started by: eranmoh
2 Replies
6. Shell Programming and Scripting
I am trying to print text between two variables in a file
I have tried the following things but none seem to work:
awk ' /'$a'/ {flag=1;next} /'$b'/{flag=0} flag { print }' file
and also
sed "/$a/,/$b/p" file
But none seem to work
Any Ideas?
Thanks in Advance (5 Replies)
Discussion started by: forumbaba
5 Replies
7. Shell Programming and Scripting
I wanted to get outcome from a big file with pattern quoted:
Line FSP LSP SR RL
Test1 100 300 4 4000
Test2 1 300 2 300
Any help is greatly appreciated. Thank you. (15 Replies)
Discussion started by: rtsiahaan
15 Replies
8. Shell Programming and Scripting
Hello all
According to the following file (orignal one contains 200x times the same structure...) I was wondering if someone could help me to print <byte>??</byte> values
example, running this script/command like
./script.sh xxapp
I would expect as output: 102 116 112
./script.sh xxapp2... (2 Replies)
Discussion started by: cabrao
2 Replies
9. Shell Programming and Scripting
Hi,
Do anybody know how to use awk to count the pattern at specific column?
Input file
M2A928K 419 ath-miR159a,gma-miR159a-3p,ptc-miR159a 60 miR235a
.
.
Output file
M2A928K 419 ath-miR159a,gma-miR159a-3p,ptc-miR159a 60 miR235a 3
.
.
I plan to count how many "miR" in column 3... (2 Replies)
Discussion started by: cpp_beginner
2 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I need to print the characters in the previous line just before the regular expression match
Please have a look at the input file as attached
I need to match the regular expression ^ with the character of the previous like and also the pin numbers
and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
LEARN ABOUT DEBIAN
shevek_regexp
shevek::regexp(3) Library Functions Manual shevek::regexp(3)
NAME
shevek::regexp -
Use regular expressions.
SYNOPSIS
#include <regexp.hh>
Public Member Functions
regexp (std::string const &pattern=std::string(), bool case_sensitive=false)
Create a new object, and optionally fill it with a pattern.
regexp & operator= (std::string const &pattern)
Set a pattern, removing the previous one.
regexp (regexp const &that)
Copy a regexp.
regexp & operator= (regexp const &that)
Copy a regexp.
void case_sensitive (bool value=true)
Set whether the evaluation should be case sensitive.
~regexp ()
Destructor, this cleans up internal structures.
bool operator() (std::string const &data)
Check whether the pattern matches a string, and fill internal match structures if it does.
std::string operator[] (unsigned idx) const
Retrieve the value of a subexpression from the last matched string.
bool valid (unsigned idx) const
Test whether a subexpression was filled by the last matching string.
unsigned size () const
Get the number of subexpression.
std::string transform (std::string const &data) const
Transform a string with -codes according to the last matching string.
std::string const & pattern () const
Get the current pattern.
Detailed Description
Use regular expressions.
Member Function Documentation
std::string shevek::regexp::operator[] (unsignedidx) const
Retrieve the value of a subexpression from the last matched string. This throws an exception if the subexpression is not valid.
Author
Generated automatically by Doxygen for libshevek from the source code.
libshevek Fri May 11 2012 shevek::regexp(3)