10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I need to extract text 'ULTIMATE and 4spaces after it' from below line
77"2686"2010-11-21 14:09:13.000"4"I"200"1"2010-11-21 14:09:14.000"001:S087110131 ULTIMATE 4.99 T""
I have used cut command :
a=`echo $line | cut -f9 -d '"' | cut -c20-31`
echo $a
But... (5 Replies)
Discussion started by: angie1234
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I need some help with the cut command, can i use it to cut a certain number of characters from string starting from the end.
say my string is like this
some junk data xyz1@pqr.com xyz2@pqr.com some more junk data
I can't exactly say how many email addresses are present in between. But the... (4 Replies)
Discussion started by: poojabhat
4 Replies
3. Shell Programming and Scripting
Hi,
I am trying to extract data from multiple output files.
I am able to extract the data from a single output file by
using the following awk commands:
awk '/ test-file*/{print;m=0}' out1.log > out1a.txt
awk '/ test-string/{m=1;c=0}m&&++c==3{print $2 " " $3 " " $4 ;m=0}' out1.log >... (12 Replies)
Discussion started by: p_sun
12 Replies
4. Shell Programming and Scripting
The script is following :
for each_rec in <file_name>
do
count=`cut -c -2 ${each_rec} | grep "45"`
echo ${count}
if ] then
amount=`cut -c 24-35 ${each_rec}`
echo ${amount}
else
echo "failed"
fi
done
And the file looks like below :
... (4 Replies)
Discussion started by: mady135
4 Replies
5. Shell Programming and Scripting
please help me writing a awk script
001_r.pdb 0.0265185
001_r.pdb 0.0437049
001_r.pdb 0.0240642
001_r.pdb 0.0310264
001_r.pdb 0.0200482
001_r.pdb 0.0146746
001_r.pdb 0.0351344
001_r.pdb 0.0347856
001_r.pdb 0.036119
001_r.pdb 1.49
002_r.pdb 0.0281011
002_r.pdb 0.0319908
002_r.pdb... (5 Replies)
Discussion started by: phoenix_nebula
5 Replies
6. Shell Programming and Scripting
I can see in the man pages how cut can be used to extract a specified string by using the -f qualifier. However, I can't find anywhere how to specify the "last" parsed segment with the cut command. If the string you are parsing is (or can be) differant each time the script is run, but you know... (4 Replies)
Discussion started by: phudgens
4 Replies
7. Shell Programming and Scripting
Hi list,
i have an orcale spool file with
SQL> select COMPMAP as SVC, ITEM, UNIT, sum(JAN), sum(FEB)
SVC ITE U SUM(JAN) SUM(FEB)
------ --- - ---------- ----------
401500 IOC Q 14 14
406200 LC Q 1 1
410124 IOC Q 5 4
410124 LC... (1 Reply)
Discussion started by: rejirajraghav
1 Replies
8. Programming
Hi,
I have a file which stores the following array :-
1,2,3,4,5.........16,17,18,19,20
This file has few hundreds of inputs of these lines.
I would like to read this file one line at a time; and assign to an array which is separated by ",".
I tried to do fgets command however,... (10 Replies)
Discussion started by: ahjiefreak
10 Replies
9. Shell Programming and Scripting
Hi,
Currently I have two files; A and B.
File A has below data:-
-3 + <1 2 3 4 5 6 7 8 1 2 > - 1]
-2 + <8 8 3 4 0 3 7 9 1 3 > - 1]
-1 + <3 7 3 4 8 2 7 2 1 2 > - 1]
-3 + <2 2 3 4 3 1 7 8 8 2 > - 1]
and File B has below data:-
<9 1 1 4 2 6 3 8 8 9 >
From these two files, I... (2 Replies)
Discussion started by: ahjiefreak
2 Replies
10. UNIX for Advanced & Expert Users
I have a problem with my loops. I have a file called users.dat, it has all the users in it. Then I extracted a list of users sending out number of mails with date from Netscape logs. The extracted list (mailuse.dat) has 3 fields: username, number of mails, date. (One user can show up several... (2 Replies)
Discussion started by: nitin
2 Replies