Merging of rows

Hi Radoulov,

Could you please help me to resolve this issue?

Yes,
try this command:

perl -ne'
  print $x, $f > 1 ? "_FIXED_\n" : "\n" 
    and ($x, $f) = undef 
    if $x and /^Type/ or eof;
  $f++ if ($x .= $_) =~ tr/\n/ /s and !/^$/;
  ' infile

If it doesn't work, try to attach (not copy/paste) a sample of your data file.

Hi,

Attached file contains the sample data. Details are mentioned in the file.
Let me know if you need more information.

Try this:

Fix the format:

dos2unix infile infile

Then try this:

perl -nle'
  if (eof || /^Type/ && @x) {
    @x > 1 and push @x, "_FIXED_";
    print join " ", @x;
    undef @x;
    }
  push @x, $_ unless /^\s*$/;
  ' infile

Hi Radoulov,

It's working !!:b:

Hope it will work without any issues. :wink:

Thank you very much for your help.
Appreciated for your time :). Thanks again.

Have a great day!! :slight_smile: