After my grep, I generated a file which has data as key and count but on separate lines:
$Value, "Some", $233kS
:2343
$AnotherCount, JunkValue
:38585
YetAnother, Nothing
:38484
I want a file like:
$Value, "Some", $233kS:2343
$AnotherCount, JunkValue:38585
YetAnother, Nothing:38484
The count pattern is fixed, it is always of form :[0-9]*
Is it possible using sed
or any single line command?
I looked at replace line but I want only when the count pattern is not matched.
I am interested in solution that can work for extended problem:
$Value, "Some", $233kS
$AnotherCount, JunkValue
:38585
YetAnother, Nothing
:38484
Should output:
$Value, "Some", $233kS$AnotherCount, JunkValue:38585
YetAnother, Nothing:38484
Basically, all the lines not matching the pattern should not have end line char.