- 论坛徽章:
- 3
|
回复 1# feiying00917 - #!/usr/bin/perl
- use strict;
- use warnings;
- use Data::Dumper;
- my @data = split /\s+/, <DATA>;
- my $k1 = shift @data;
- my $h;
- while (<DATA>) {
- my ( $k2, @line ) = split;
- $h->{$k1}->{$k2}->{$_} = shift @line for @data;
- }
- print Dumper \$h;
- __DATA__
- InstUin Netlist RefDes Component UinNum SchUinName UinName
- J1:1:U3_3V_U1 1 J1 SAS_29UIN U1 3.3V_1 U3_3V_U1
- J1:1:GND_U10 1 J1 SAS_29UIN U10 GND10 GND_U10
- J1:1:READY_LED 1 J1 SAS_29UIN U11 READY_LED READY_LED
- J1:1:GND_U12 1 J1 SAS_29UIN U12 GND11 GND_U12
- J1:1:U12V_URECHARGE 1 J1 SAS_29UIN U13 12VURCHG
复制代码 |
|