sed problem with double point


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sed problem with double point
# 1  
Old 10-05-2011
sed problem with double point

I have a problem with the next text

00:00:27,761 --> 00:00:31,094
MADSO: Boston. Southie. I was born here.

00:00:31,197 --> 00:00:36,692
Never left. Never had any reason.
Good friends, plenty of girls.
--------------------------------------------------
I want delete MADSO: and leave all the rest.
I tried 's/[A-Z]*://' but than I have
0000:27,761 --> 00:00:31,094
Boston. Southie. I was born here.

0000:31,197 --> 00:00:36,692
Never left. Never had any reason.
Good friends, plenty of girls.
-----------------------------------------------
So sed takes the first double point away on the line with numbers and that cannot.
I tried 's/^[A-Z:\t]*//'
Than sed leaves the double point between the numbers but now
he take on every line the first letter away so than I have this:

00:00:27,761 --> 00:00:31,094
Boston. Southie. I was born here.

00:00:31,197 --> 00:00:36,692
ever left. Never had any reason.
ood friends, plenty of girls.
----------------------------------------------------
Does someone have a solution for this?
Thank you very much.
# 2  
Old 10-05-2011
Code:
sed  's/^[A-Z][A-Z]*://'

or GNU sed with ERE (extended regular expressions):
Code:
sed -r 's/^[A-Z]+://'

This User Gave Thanks to yazu For This Post:
# 3  
Old 10-05-2011
Try like...
Code:
sed 's/^[A-Z:]* //' inputfile

This User Gave Thanks to michaelrozar17 For This Post:
# 4  
Old 10-05-2011
Code:
sed 's/^[A-Z]*:[ \t]*//' file

This User Gave Thanks to Scrutinizer For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace double double quotes using AWK/SED

Hi, I have data as "01/22/97-"aaaaaaaaaaaaaaaaa""aaa""aabbbbbbbbcccccc""zbcd""dddddddddeeeeeeeeefffffff" I want to remove only the Consequitive double quotes and not the one which occurs single. My O/P must be ... (2 Replies)
Discussion started by: Bhuvaneswari
2 Replies

2. Shell Programming and Scripting

problem with floating point number loops

Hey, I guess I am just to stupid and am not seeing the "wood for the trees", but I am always getting strange errors. I want to create a mesh with coordinates like: x y z 3.1 3.0 0.75 0 0 1 3.1 2.9 0.75 0 0 1 3.1 2.8 0.75 0 0 1 3.1 2.7 0.75 0 0 1 3.0 ... (10 Replies)
Discussion started by: ergy1983
10 Replies

3. Red Hat

NFS mount point problem

Hi Forum I am trying to mount /NFS as nfs mountpoint on two servers ( A & B ). After mounting the nfs filesystem, both of them behave normally for around 10 mins and after that the NFS file handle become stale and the mountpoints dont respond. While executing df -kh, the output hang out and the... (15 Replies)
Discussion started by: rajdasuwal
15 Replies

4. Shell Programming and Scripting

floating point number problem

Hello folks I Hope everyone is fine. I am calculating number of bytes calculation from apache web log. awk '{ sum += $10 } END { print sum }' /var/httpd/log/mydomain.log 7.45557e+09 it show above number, what should i do it sow number like 7455, i mean if after decimal point above 5 it... (5 Replies)
Discussion started by: learnbash
5 Replies

5. Shell Programming and Scripting

SED for delete the point

Hello i need to use sed for delete all row that begin with "." i try whit sed -e /^/d but it don't work help me please :) (5 Replies)
Discussion started by: tor
5 Replies

6. Shell Programming and Scripting

sed to extract only floating point numbers from HTML

Hi All, I'm trying to extract some floating point numbers from within some HTML code like this: <TR><TD class='awrc'>Parse CPU to Parse Elapsd %:</TD><TD ALIGN='right' class='awrc'> 64.50</TD><TD class='awrc'>% Non-Parse CPU:</TD><TD ALIGN='right' class='awrc'> ... (2 Replies)
Discussion started by: pondlife
2 Replies

7. Solaris

ZFS mount point - problem

Hi, We are using ZFS to take the sanpshots in our solaris 10 servers. I have the problem when using ZFS mount options. The solaris server we are used as, SunOS emch-mp89-sunfire 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V440Sys tem = SunOS Steps: 1. I have created the zfs... (4 Replies)
Discussion started by: mgmk.84
4 Replies

8. Programming

floating point problem

Hi all! Hi all! I am working with a problem to find the smallest floating point number that can be represented. I am going in a loop ,stating with an initial value of 1.0 and then diving it by 10 each time thru the loop. So the first time I am getting o.1 which I wanted.But from the next... (4 Replies)
Discussion started by: vijlak
4 Replies

9. Programming

Point and Array Convert Problem

In this statement,"A" of type "int",being converted to "pointer toarray of int".(cvtdiftypes) Please help me! #include <stdio.h> #include <stdlib.h> int m,k; const int max =20; int A; //**************************************************** // Input Matrix ... (0 Replies)
Discussion started by: zhshqzyc
0 Replies

10. Shell Programming and Scripting

problem with floating point numbers in awk

hi all, i have the following problem using awk in a script i want to read the values from a column with real numbers and calculate the mean.the problem is that when i use a statement such as this num = $4 i cant find a way to convert the variable from string to floating point to perform... (7 Replies)
Discussion started by: kanagias
7 Replies
Login or Register to Ask a Question