10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need help on a complicated file that I am working on. I wanted to extract important info from a very huge file. It is space delimited file. I have hundred thousands of records in this file. An example content of the inputfile as below:-
##
ID Ser402 Old; 23... (2 Replies)
Discussion started by: redse171
2 Replies
2. AIX
Hi all,
I am struck with the below requirement. I need to grep a particular pattern in a file and then print next n lines of it for further processing.
I have used the below code
grep -A 3 "pattern" filename
But it is throwing error as below.
grep: illegal option -- A
Can... (14 Replies)
Discussion started by: ssk250
14 Replies
3. Shell Programming and Scripting
Input file:
pattern1 100 250 US
pattern2 50 3050 UK
pattern3 100 250 US
pattern1 70 1050 UK
pattern1 170 450 Mal
pattern2 40 750 UK
.
.
Desired Output file:
pattern1 100 250 US
pattern2 50 3050 UK
pattern1 170 450 Mal
pattern2... (3 Replies)
Discussion started by: cpp_beginner
3 Replies
4. Shell Programming and Scripting
Hi,
Do anybody know how to print out only those record that column 1 is "a" , then followed by "b"?
Input file :
a comp92 2404242 2405172
b comp92 2405303 2406323
b comp92 2408786 2410278
a comp92 2410271 2410337
a comp87 1239833 1240418
b comp87... (3 Replies)
Discussion started by: patrick87
3 Replies
5. Shell Programming and Scripting
how to use "awk" to print any record has pattern not equal ? for example my file has 5 records & I need to get all lines which $1=10 or 20 , $2=10 or 20 and $3 greater than "130302" as it shown :
10 20 1303252348212B030
20 10 1303242348212B030
40 34 1303252348212B030
10 20 ... (14 Replies)
Discussion started by: arm
14 Replies
6. UNIX for Dummies Questions & Answers
Hi !
I have a tab-delimited file, file.tab:
Column1 Column2 Column3
aaaaaaaaaa bbtomatoesbbbbbb cccccccccc
ddddddddd eeeeappleseeeeeeeee ffffffffffffff
ggggggggg hhhhhhtomatoeshhh iiiiiiiiiiiiiiii
... (18 Replies)
Discussion started by: lucasvs
18 Replies
7. Shell Programming and Scripting
Input file:
data100_content1 420 700
data101_content1 107 516
data101_content2 194 773
data101_content3 195 917
data104_content2 36 325
data105_content1 505 605
data106_content1 291 565 ... (7 Replies)
Discussion started by: perl_beginner
7 Replies
8. Shell Programming and Scripting
Hi,
i would like to get the above and below lines of the grep pattern .
For ex :
file as below:
chk1- aaaa
1-Nov
chk2 -aaaa
##########
chk1-bbbbbb
1-Nov
chk2-bbbbbb
#########
my search pattern is date : 1-Nov
i need the o/p as below
chk1- aaaa
1-Nov (6 Replies)
Discussion started by: expert
6 Replies
9. Solaris
Hi all,
Is it possible for grep to output just the pattern match and not the whole line when it comes across a match? I know you can adjust the number of trailing or leading lines that are printed, but am yet to find anything that outputs just the pattern match.
Cheers,
Tim (5 Replies)
Discussion started by: muzzaw
5 Replies
10. Shell Programming and Scripting
I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this).
For example, i have a input file1.txt:
cat inputfile1.txt
218299910417
1172051195
1172070231
1172073514
1183135117
1183135118
1183135119
1281440202
... (3 Replies)
Discussion started by: poliver
3 Replies