Overclock.net banner

1 - 2 of 2 Posts

·
Premium Member
Joined
·
65,162 Posts
Discussion Starter #1
I have the following trailer row stored in the variable $temp_row:

Code:

Code:
07/14/2009|(71/950)|(24/950)|(205/950)|(23/950)|(19/950)|(11/950)|-188837594.64|(100/950)|182830526.95|(3/950)|(336/950)|(934/950)|
I need to extract the record count which would be "950" in this case. My pseudocode is:
1) Delete up to the first "("
2) Delete up to the first "/"
3) Print up to the first ")"

What is wrong with my SED statement for part 1?

Code:

Code:
sed "1,/(/ d" $temp_row > $temp_row
 

·
Premium Member
Joined
·
65,162 Posts
Discussion Starter #2
Nevermind... used "cut" instead:

Code:
Code:
echo $temp_row | cut -d'(' -f2 | cut -d'/' -f2 | cut -d')' -f1
 
1 - 2 of 2 Posts
Top