Output:#!/usr/bin/perl use strict; use warnings; my @header; map { unless (/;$/) { chomp; scalar @header == 2 and undef @header; scalar @header and $_ = ":$_"; push @header, $_; } print @header, ":$_" if /;$/; } <DATA>; __DATA__ library_AND PIN.A DELAY_TABLE 1 20 2 40 3 60 4 65 5 75; DELAY_TABLE 1 10 2 15 3 45 4 70 5 80; POWER_TABLE 20 30 40 50 80 97 110 20; POWER_TABLE 3 4 5 6 10 80 90 10 20; library_BUF PIN.B LEAKAGE 1 2 3 4; TRANSIT 1.1 2 3.4;
library_AND:PIN.A:DELAY_TABLE 1 20 2 40 3 60 4 65 5 75; library_AND:PIN.A:DELAY_TABLE 1 10 2 15 3 45 4 70 5 80; library_AND:PIN.A:POWER_TABLE 20 30 40 50 80 97 110 20; library_AND:PIN.A:POWER_TABLE 3 4 5 6 10 80 90 10 20; library_BUF:PIN.B:LEAKAGE 1 2 3 4; library_BUF:PIN.B:TRANSIT 1.1 2 3.4;
In reply to Re: Need help with line concatenation
by poolpi
in thread Need help with line concatenation
by noobee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |