[Feature]Upload Modem source code
Change-Id: Id4294f30faced84d3e6fd6d5e61e1111bf287a37
diff --git a/mcu/tools/init/format_pipe.pl b/mcu/tools/init/format_pipe.pl
new file mode 100644
index 0000000..af5f497
--- /dev/null
+++ b/mcu/tools/init/format_pipe.pl
@@ -0,0 +1,35 @@
+use strict;
+
+my $backup = $/;
+undef $/;
+my $input = <>;
+$/ = $backup;
+
+my @text = split(/[\n\r]+/, $input);
+my $flag_7z = 0;
+foreach my $line (@text)
+{
+ next if ($line eq "");
+ if (($line =~ /^\s*7-Zip/i) || ($line =~ /^\s*Listing archive/i))
+ {
+ $flag_7z = 1;
+ next;
+ }
+ if ($flag_7z)
+ {
+ if ($line =~ /^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\d+)\s+(\d+)\s+(.+)\s*$/)
+ {
+ $line = $6;
+ }
+ else
+ {
+ next;
+ }
+ }
+ $line =~ s/\\/\//g;
+ next if ($line =~ /\/$/);
+ next if (-d $line);
+ $line =~ s/ /\\?/g;
+ $line =~ s/\#/\\\\\\#/g;
+ print $line . "\n";
+}