06-28-2011
thanks itkamaraj!!
its working
10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
I hope this is a basic question.
I have a file with a bunch of strings in each line (and the string number is variable).
What I want to do is a simple if command and then print the entire line.
something like awk '{if ($3=="yes") print $1,$2,$3,...$X }' infile > outfile
Can someone... (1 Reply)
Discussion started by: dcfargo
1 Replies
3. Shell Programming and Scripting
Hi friends,
This is my very first post on forum, so kindly excuse if my doubts are found too silly.
I am trying to automate a piece of routine work and this is where I am stuck at the moment-I need to grep a particular ID through a file containing many records(which start with <LRECORD> and end... (6 Replies)
Discussion started by: faiz1985
6 Replies
4. Shell Programming and Scripting
Friends,
I have .txt file with 3 millions of rows.
File1.txt
ABC1|A|ABCD1|XYZ1
ABC2|P|ABCD2|XYZ2
ABC3|A|ABCD3|XYZ3
ABC4|P|ABCD4|XYZ4
If second field has value P then print the entire line.
Thanks in advance for your help,
Prashant (4 Replies)
Discussion started by: ppat7046
4 Replies
5. Shell Programming and Scripting
Hi,
i have a file with content
00:01:20.613 'integer32' 459254
00:01:34.158 459556
00:01:36.626 'integer32' 459255
and i want to print only output as below
00:01:20.613 459254
00:01:34.158 459556
00:01:36.626 459255
i dont want the word 'integer32' which is the second column.
i... (2 Replies)
Discussion started by: dealerso
2 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have a file with 32 columns and I want to print one column at a time, and then read each line of this column in order to use grep command.
I tried with awk but i cannot put variable in awk
for a in {1..32..1};do awk '{print$a}' file1.txt|while read line;do grep $line file2.txt;done >... (5 Replies)
Discussion started by: FelipeAd
5 Replies
7. Shell Programming and Scripting
Hi All,
I have to match each row in file 1 with 1st row in file 2 and print the corresponding column from file2. I am trying to use an awk script to do this. For example
cat File1
X1
X3
X4
cat File2
ID X1 X2 X3 X4
A 1 6 2 1
B 2 7 3 3
C 3 8 4 1
D 4 9 1 1 (3 Replies)
Discussion started by: newpro
3 Replies
8. Shell Programming and Scripting
hey guys,
for the following output:
starting
open
open
close
close
starting
close
starting
open
close
close
starting
open
open
close
open (2 Replies)
Discussion started by: boaz733
2 Replies
9. Shell Programming and Scripting
I have a file with class c IP addresses that I need to match to a column and print the matching lines of another file.
I started playing with grep -if file01.out file02.out but I am stuck as to how to match it to a column and print the matching lines;
cat file01.out
10.150.140... (5 Replies)
Discussion started by: lewk
5 Replies
10. Shell Programming and Scripting
Hello,
I have to fish out some specific columns from a file based on the header value. I have the list of columns I need in a different file. I thought I could read in the list of headers I need,
# file with header names of required columns in required order
headers_file=$2
# read contents... (11 Replies)
Discussion started by: LMHmedchem
11 Replies