Wednesday, May 15, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 3938  / 3 Years ago, sat, october 23, 2021, 7:52:49

I entered a list of number in Calc and saved it as CSV so that all the values on one line are separated by commas. I will describe what I'm seeking with bash in the following example:



INPUT



22,33
45,533


OUTPUT



22:33,45:533

More From » bash

 Answers
5

Not sure if I understand correctly, but for the input and output you shown, the following sed command can do the transformation, taking into account that your input file contains CR-LF line terminators:



sed 's/,/:/g;s/ /,/g' <<<$(tr -d '
' <input_file) | tee output_file.tmp
mv output_file.tmp input_file

[#41191] Monday, October 25, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
calronze

Total Points: 0
Total Questions: 110
Total Answers: 112

Location: Belarus
Member since Thu, Aug 11, 2022
2 Years ago
;