Skip to main content
deleted 2 characters in body
Source Link
Costas
  • 15k
  • 24
  • 38

Same for sed

sed -E 's&(.*M)( .*);( .*)$&<wpt\2\3>\n\t<time>\1</time>\n</wpt>&;
        $!G;
        s& = ([-.0-9]+)&="\1"&g' log.file

Or put it in the script-file

#!/bin/sed -E -fEf
s|(.*M)( .*);( .*)$|<wpt\2\3>\n\t<time>\1</time>\n</wpt>|
$!G
s| = ([-.0-9]+)|="\1"|g

And use it

sed -Ef script.file log.file

or if have made it executable by chmod +x ./script.file just

./script.file log.file

Same for sed

sed -E 's&(.*M)( .*);( .*)$&<wpt\2\3>\n\t<time>\1</time>\n</wpt>&;
        $!G;
        s& = ([-.0-9]+)&="\1"&g' log.file

Or put it in the script-file

#!/bin/sed -E -f
s|(.*M)( .*);( .*)$|<wpt\2\3>\n\t<time>\1</time>\n</wpt>|
$!G
s| = ([-.0-9]+)|="\1"|g

And use it

sed -Ef script.file log.file

or if have made it executable by chmod +x ./script.file just

./script.file log.file

Same for sed

sed -E 's&(.*M)( .*);( .*)$&<wpt\2\3>\n\t<time>\1</time>\n</wpt>&;
        $!G;
        s& = ([-.0-9]+)&="\1"&g' log.file

Or put it in the script-file

#!/bin/sed -Ef
s|(.*M)( .*);( .*)$|<wpt\2\3>\n\t<time>\1</time>\n</wpt>|
$!G
s| = ([-.0-9]+)|="\1"|g

And use it

sed -Ef script.file log.file

or if have made it executable by chmod +x ./script.file just

./script.file log.file
Source Link
Costas
  • 15k
  • 24
  • 38

Same for sed

sed -E 's&(.*M)( .*);( .*)$&<wpt\2\3>\n\t<time>\1</time>\n</wpt>&;
        $!G;
        s& = ([-.0-9]+)&="\1"&g' log.file

Or put it in the script-file

#!/bin/sed -E -f
s|(.*M)( .*);( .*)$|<wpt\2\3>\n\t<time>\1</time>\n</wpt>|
$!G
s| = ([-.0-9]+)|="\1"|g

And use it

sed -Ef script.file log.file

or if have made it executable by chmod +x ./script.file just

./script.file log.file