Question: As mentioned in the title, I'm unable to simultaneously record my headset microphone *and* my desktop audio when using SimpleScreenRecorder in KDE Neon 5.24.

In the "Audio Input" section of the recording settings, I selected "PulseAudio" as **Backend**, whereas for **Source** I've tried both "Built-in Audio Analog Stereo" as well as "Monitor of Built-in Audio Analog Stereo" (see below):

[![enter image description here](https://i.stack.imgur.com/Iagkh.png)](https://i.stack.imgur.com/Iagkh.png)

When selecting "Built-in Audio Analog Stereo", the microphone gets recorded but the desktop audio does not, while the situation is exactly the opposite when I select "Monitor of Built-in Audio Analog Stereo" (can record desktop audio but not headset microphone).

Does anybody have an idea of how to solve this issue?

Answer: 
A Perl way:

```
$ perl -00 -ne 'print join(",",split(/\n/)) . "\n"; ' file
St1,number1,1234
St2,number2,456

```

The `-00` turns on perl's "paragraph mode" where "lines" are defined by `\n\n`, so each paragraph is treated as a single "line". The `-n` means "read the input file line by line and apply the script given by `-e` to each line. The script will split the input line on `\n` (newline: end of line character) and then join the resulting elements with a `,`. This is all printed along with a trailing newline.

You could write the same thing like this for clarity:

```
$ perl -00 -ne '@fields=split(/\n/); $out=join(",",@fields); print "$out\n" ' file
St1,number1,1234
St2,number2,456

```

Or like this, for fun:

```
$ perl -00 -pe '$_=join(",",split(/\n/))."\n";' file
St1,number1,1234
St2,number2,456

```
Replace all newlines by commas. Empty newlines will create two consecutive commas: re-replace those with a proper newline. Also take care of the dangling comma at the end on the last line.

```
tr '\n' ',' <infile | sed 's/,,/\n/;$s/,$//'

```