10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I need to egrep patterns in a file and limit number of matches to print for each matched pattern.
-m10 option is not working out in my sun solaris 5.10
Please guide me the options to achieve.
if i do head -10 , i wont be getting all pattern match results as output since for a... (10 Replies)
Discussion started by: ananan
10 Replies
2. Shell Programming and Scripting
echo 'String#1 and String#2' | egrep -o -m 1 'String#.{1}'
String#1
String#2
I'm trying to just match the first occurrence of 'String#' + 1 character. I thought the "-m 1" switch would do that for me. Instead I get both occurrences. Can somebody provide some insight?
Thanks! (5 Replies)
Discussion started by: sudo
5 Replies
3. Shell Programming and Scripting
I'd like to read a file (mydata.dat) line by line. The file consists of 5 columns filled with numbers, like so:
83.018 1.953 49.587 20550.000 353
83.213 1.953 49.195 20600.000 171
84.935 1.954 48.803 20650.000 920
For every read line (i.e. in every... (2 Replies)
Discussion started by: pina
2 Replies
4. Shell Programming and Scripting
not getting anywhere with this
an xml file contains multiple clients set up with same tags, different values.
I need to parse the file for client foo, and change the value of tag "64bit" from false to true.
cat clients.xml
<Client type"FIX">
<ClientName>foo</ClientName>... (3 Replies)
Discussion started by: jack.bauer
3 Replies
5. Shell Programming and Scripting
So far what i've got is
egrep '^(\\)\*$'No luck.
I've searched the web and not much luck. I know about the escape character \ but its confusing to figure out how to use it to match a backslash and use it to escape the asterisk also. Any ides? Thanks! (8 Replies)
Discussion started by: matthewfs
8 Replies
6. Shell Programming and Scripting
I want to match the number exactly from the variable which has multiple numbers seperated by pipe symbol similar to search in egrep.below is the code which i tried
#!/usr/bin/perl
my $searchnum = $ARGV;
my $num = "148|1|0|256";
print $num;
if ($searchnum =~ /$num/)
{
print "found";
}... (2 Replies)
Discussion started by: kar_333
2 Replies
7. Shell Programming and Scripting
I need to take one column of data and put it into the following format:
1st line,2nd line
3rd line,4th line
5th line,6th line
...
Thanks! (6 Replies)
Discussion started by: batcho
6 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I want to retrieve 2, 6, 10, 14...... (each 4 lines apart) from a file that looks like the sample below. In other words, I want only lines corresponding to the Xs.
Header1_a
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Header1_b
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Header2_a... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies
9. Shell Programming and Scripting
How to replace all after 4 character at line? & convert to upper case ?
google.com -> GOOG (2 Replies)
Discussion started by: Trump
2 Replies
10. UNIX for Dummies Questions & Answers
Assume I have a text file as below:
me
con pi
ind ken
pras ur
me
con rome
ind kent
pras urs
pintu
con mys
ind pan
pras ki
con kit
ind sys
My requirement,
I need to search for "con rome" and if exists, then print 4th word from rome, i.e in above example, since "con rome"... (4 Replies)
Discussion started by: jaggesh
4 Replies