Convert:
...
1|30|1|201002|745.11267931439|84.34214120933
1|30|1|201003|864.95194019049|322.6665129525
1|30|1|201006|831.27144204046|56.168021427546
...
into (truncate fractionals after 3 digits):
1|30|1|201002|745.112|84.342
1|30|1|201003|864.951|322.666
1|30|1|201006|831.271|56.168
use:
cat myfile | perl -pe 's/(?<=\.[0-9]{3})[0-9]*//g;'
note:
-p implies
while (<>) {
...
} continue {
print or die "-p destination: $!\n";
}
No comments:
Post a Comment