in reply to create an one-line format for this
Here's another option:
use strict; use warnings; local $/ = "//\n"; while (<>) { chomp; my ( $len, $id, $parts ) = /(\d+)\s+(.+?)\n(.+)/s; $parts =~ s/\n//g; $parts =~ /.{$len}/p; print ">$id\n${^MATCH}\n${^POSTMATCH}\n" }
If you're using Perl v5.14+, you can combine the substitution and matching into a single line as follows:
$parts =~ s/\n//gr =~ /.{$len}/p;Hope this helps!
|
|---|