10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have requirement to search for a text in the file and retrieve required lines that is user defined with unix command.
Eg:
Find the text UNIX in the below file and need to return Test 8 & Test 9
Test 1
Test 2
Test 3
Test 4
UNIX
Test 5
Test 6
Test 7
Test 8
Test 9
Result can... (8 Replies)
Discussion started by: Arunkumarsak4
8 Replies
2. Shell Programming and Scripting
i had requirement like i need to get "error" line of above 3 and below 3 from a file .I tried with the below script.But it's not working.
y='grep -n -i error /home/file.txt|cut -c1'
echo $y
head -$y /home/file.txt| tail -3 >tmp.txt
tail -$y /home/file.txt head -3 >>tmp.txt (4 Replies)
Discussion started by: bhas85
4 Replies
3. Shell Programming and Scripting
Hi,
I have a file with 20 columns of data and hundreds of lines of the same format.
Here is an example line. The data repeats underneath with the same format.
15 1 4 GLY - 1 65 LYSH 23 N - 24 H - 634 O 0.188 157.552 487 48.70I have been sorting this data by hand but I was wondering if I... (3 Replies)
Discussion started by: livbaddeley
3 Replies
4. Shell Programming and Scripting
Hi guys
I have a several thousands line file in the following format:
n817
--------------------------------------------------
n842
--------------------------------------------------
n877
--------------------------------------------------
n513
/bb/data/rmt2db.lrl:JBSKDB 31915 75... (4 Replies)
Discussion started by: aoussenko
4 Replies
5. Shell Programming and Scripting
Hi all,
I have a file with many records with information as given below
ID A16L2_HUMAN Reviewed; 619 AA.
AC Q8NAA4; A5PL30; B2RPK5; Q658V4; Q6PID3; Q8NBG0;
DT 20-MAY-2008, integrated into UniProtKB/Swiss-Prot.
DT 20-MAY-2008, sequence version 2.
DT ... (1 Reply)
Discussion started by: kaav06
1 Replies
6. Shell Programming and Scripting
hi,
i have two files.
file1.sh
echo "unix"
echo "linux"
file2.sh
echo "unix linux forums"
now the output i need is
$./file2.sh
unix linux forums (3 Replies)
Discussion started by: snreddy_gopu
3 Replies
7. Shell Programming and Scripting
Hi,
I have a file with the following structure.
XXXXX...........
YYYYY...........
.................
..................
ZZZZZZ......
qwerty_start..............
..................
.................
..................
querty_end................
.............................. (1 Reply)
Discussion started by: abinash
1 Replies
8. UNIX for Dummies Questions & Answers
Hiiii
I have a file which contains huge data as
a.dat:
PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA
event name: 010990D
time shift: 7.3000
half duration: 5.0000
latitude: 24.4200
longitude: 94.9500
depth: 129.6000
Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies
9. Shell Programming and Scripting
Hi Techies,
I got struck in middle of a problem. I have the following data whose format is:
a 1
a 2
a 3
a 4
b 1
b 2
b 3
b 4
c 1
c 2
c 3
c 4
I wanted the output from this to be:
a 3
a 4 (11 Replies)
Discussion started by: 14341
11 Replies
10. Shell Programming and Scripting
I have a file containing the following contents
All of us, including Zippy, our dog
All of us, including Zippy and Zippy
All of us, including Zippy and Zippy and Zelda
Testing All of us Zippy
Now, i wanna grep and get the lines which has only one occurance of word Zippy and starting with... (1 Reply)
Discussion started by: google_ever
1 Replies