Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 3934  / 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
calronze questions
Sun, Jan 9, 22, 13:41, 2 Years ago
Wed, Feb 15, 23, 01:41, 1 Year ago
Sat, Jul 23, 22, 21:03, 2 Years ago
Sat, Feb 5, 22, 01:57, 2 Years ago
;