Hi Avraham,

I'd go for something more strict like:
sed "s/\([0-9][0-9]:[0-9][0-9]\)\([^\t]*\t\t\)\([0-9][0-9]:[0-9][0-9]\).*/\1-\3 
$1 \2/"

Dotan


On Saturday 19 May 2007, Avraham Rosenberg wrote:
> Hi,
> The problem popped up in the frame of my attempts to switch to
> utf8. I opened a uxterm window with the command:
> LC_TYPE=he_IL.UTF8 uxterm -sb -sl 500  -xrm 'xterm*pointerShape:
> hand2' -geometry 100x40 -bg grey90 -fg black -fn
> '-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1'&
>
> and tried to execute a script involving sed.
> In its simplest form, it looks like:
> cat v | start-end2
> where v is:
>       21:45 Les elephants d'Hannibal          22:35 360° Le reportage GEO
>       22:35 360° Le reportage GEO             22:36 Les metallos de Chicago
>       22:36 Les metallos de Chicago           21:45 Les elephants d'Hannibal
> and start-end2 is
> #!/bin/sh
> sed "s/\([0-9][0-9]:[0-9][0-9]\)\(.*          
> \)\([0-9][0-9]:[0-9][0-9]\).*/\1-\3
> $1 \2/"
>
> The big space in the script (2 tabs) corresponds to the two tabs between
> the two columns of v
>
> In the uxterm window, the output was:
>       21:45-22:35   Les elephants d'Hannibal          ° Le reportage GEO
>       22:35 360° Le reportage GEO             22:36 Les metallos de Chicago
>       22:36-21:45   Les metallos de Chicago
> Instead of the normal output (in the xterm window):
>       21:45-22:35   Les elephants d'Hannibal
>       22:35-22:36   360° Le reportage GEO
>       22:36-21:45   Les metallos de Chicago
> sed version: GNU sed version 4.1.5
>
> Should I update/replace my sed or use some command-line option to
> make it behave similarly in the two environements ?
> Thanks, Avraham



================================================================To unsubscribe, 
send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

  • sed Avraham Rosenberg

Reply via email to