Hi I want to read a text file and replace various number of spaces between each string in to a single "," or any other character .Please let me know the command to do so. My input file is a txt file which is the output of a SQL table extract so it contains so many spaces between each column of the table.:(
tried this command
tr ' ' ',' < input_file.txt > output_file.txt
but it is converting eachspace into a single charecter so the output is like
name,,,,,age,,,,job,,,,,,
where each space is replaced by comma.
i just want all the spaces in between each column into a single comma like the below one
name,age,job
Please help me with a command or a set of commands to convert the output in the format i asked.