PHP.EE FOORUM   
Nimi:   Pass:   Mäleta mind! 
   Teemad | php.ee esilehele | registreeri | Märgi kõik teemad loetuks | #php.ee Skype vestlus | RSS
UUS TEEMA  OTSI  Lehekülgi: 1
Tekst edasiseks kasutuseks
Postitaja: parser 2015-06-28 01:20:00
Tere,

kas keegi oskab nõu anda, kuidas tekstidega peaks ümber käima,
mind huvitab nt dmidecode väljundi töötlemine

nt kui ma terminal sisestan:
dmidecode -q -t memory

on tulemuseks:


Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 32 GB
Number Of Devices: 4

Memory Device
Total Width: 72 bits
Data Width: 64 bits
Size: 8192 MB
Form Factor: DIMM
Set: None
Locator: DIMM A2
Bank Locator: BANK 0
Type: DDR3
Type Detail: Synchronous Unbuffered (Unregistered)
Speed: 1600 MHz
Manufacturer: 80AD000080AD
Serial Number: 3006C0EB
Asset Tag: 011403
Part Number: HMT41GU7AFR8A-PB
Rank: 2
Configured Clock Speed: 1600 MHz

Memory Device
Total Width: 72 bits
Data Width: 64 bits
Size: 8192 MB
Form Factor: DIMM
Set: None
Locator: DIMM A1
Bank Locator: BANK 1
Type: DDR3
Type Detail: Synchronous Unbuffered (Unregistered)
Speed: 1600 MHz
Manufacturer: 802C0000802C
Serial Number: 2985D774
Asset Tag: 0F1401
Part Number: 18KSF1G72AZ-1G6E1
Rank: 2
Configured Clock Speed: 1600 MHz

Memory Device
Total Width: 72 bits
Data Width: 64 bits
Size: 8192 MB
Form Factor: DIMM
Set: None
Locator: DIMM B2
Bank Locator: BANK 2
Type: DDR3
Type Detail: Synchronous Unbuffered (Unregistered)
Speed: 1600 MHz
Manufacturer: 80CE000080CE
Serial Number: 179D1940
Asset Tag: 031436
Part Number: M391B1G73QH0-YK0
Rank: 2
Configured Clock Speed: 1600 MHz

Memory Device
Total Width: 72 bits
Data Width: 64 bits
Size: 8192 MB
Form Factor: DIMM
Set: None
Locator: DIMM B1
Bank Locator: BANK 3
Type: DDR3
Type Detail: Synchronous Unbuffered (Unregistered)
Speed: 1600 MHz
Manufacturer: 802C0000802C
Serial Number: 2985D773
Asset Tag: 0F1401
Part Number: 18KSF1G72AZ-1G6E1
Rank: 2
Configured Clock Speed: 1600 MHz

Memory Controller Information
Error Detecting Method: None
Error Correcting Capabilities:
None
Supported Interleave: One-way Interleave
Current Interleave: One-way Interleave
Maximum Memory Module Size: 8192 MB
Maximum Total Memory Size: 16384 MB
Supported Speeds:
Other
Supported Memory Types:
Other
Memory Module Voltage: Unknown
Associated Memory Slots: 2
0xFFFF
0xFFFF
Enabled Error Correcting Capabilities:
None


Tahaks saada midagi sellist:
Tegelikult ei ole oluline just alltoodud struktuur,
vaid MINGIGI struktuur, mida on võimalik hiljem massiivina/objektina kasutada


PHP kood:
 

$parsed 
= array (
    
    
'Physical Memory Array' => array ( 'Location' => 'System Board Or Motherboard',
        
'Use' => 'System Memory',
        
'Error Correction Type' => 'Multi-bit ECC',
        
'Maximum Capacity' => '32 GB',
        
'Number Of Devices' => '4' ),
        
    
'Memory Device' => array (
        
=> array ( 'Total Width' => '72 bits',
            
'Data Width' => '64 bits',
            
'Size' => '8192 MB',
            
'Form Factor' => 'DIMM',
            
'Set' => 'None',
            
'Locator' => 'DIMM A2',
            
'Bank Locator' => 'BANK 0',
            
'Type' => 'DDR3',
            
'Type Detail' => 'Synchronous Unbuffered (Unregistered)',
            
'Speed' => '1600 MHz',
            
'Manufacturer' => '80AD000080AD',
            
'Serial Number' => '3006C0EB',
            
'Asset Tag' => '011403',
            
'Part Number' => 'HMT41GU7AFR8A-PB',
            
'Configured Clock Speed' => '1600 MHz' ),
        
=> array ( 'Total Width' => '72 bits',
            
'Data Width' => '64 bits',
            
'Size' => '8192 MB',
            
'Form Factor' => 'DIMM',
            
'Set' => 'None',
            
'Locator' => 'DIMM A1',
            
'Bank Locator' => 'BANK 1',
            
'Type' => 'DDR3',
            
'Type Detail' => 'Synchronous Unbuffered (Unregistered)',
            
'Speed' => '1600 MHz',
            
'Manufacturer' => '80AD000080AD',
            
'Serial Number' => '3006C0EB',
            
'Asset Tag' => '011403',
            
'Part Number' => '18KSF1G72AZ-1G6E1',
            
'Configured Clock Speed' => '1600 MHz' ),
        
=> array ( 'Total Width' => '72 bits',
            
'Data Width' => '64 bits',
            
'Size' => '8192 MB',
            
'Form Factor' => 'DIMM',
            
'Set' => 'None',
            
'Locator' => 'DIMM B2',
            
'Bank Locator' => 'BANK 2',
            
'Type' => 'DDR3',
            
'Type Detail' => 'Synchronous Unbuffered (Unregistered)',
            
'Speed' => '1600 MHz',
            
'Manufacturer' => '80AD000080AD',
            
'Serial Number' => '3006C0EB',
            
'Asset Tag' => '011403',
            
'Part Number' => 'M391B1G73QH0-YK0',
            
'Configured Clock Speed' => '1600 MHz' ),
        
=> array ( 'Total Width' => '72 bits',
            
'Data Width' => '64 bits',
            
'Size' => '8192 MB',
            
'Form Factor' => 'DIMM',
            
'Set' => 'None',
            
'Locator' => 'DIMM B1',
            
'Bank Locator' => 'BANK 3',
            
'Type' => 'DDR3',
            
'Type Detail' => 'Synchronous Unbuffered (Unregistered)',
            
'Speed' => '1600 MHz',
            
'Manufacturer' => '80AD000080AD',
            
'Serial Number' => '3006C0EB',
            
'Asset Tag' => '011403',
            
'Part Number' => '18KSF1G72AZ-1G6E1',
            
'Configured Clock Speed' => '1600 MHz' )
    ),
    
    
'Memory Controller Information' => array ( 'Error Detecting Method' => 'None',
        
'Error Correcting Capabilities' => array ( 'None' ) ),
        
'Supported Interleave' => 'One-way Interleave',
        
'Current Interleave' => 'One-way Interleave',
        
'Maximum Memory Module Size' => '8192 MB',
        
'Maximum Total Memory Size' => '16384 MB'
        'Supported Speeds' 
=> array ( 'Other' ),
        
'Supported Memory Types' => array ( 'Other' ),
        
'Memory Module Voltage' => 'Unknown',
        
// see siin on veic kahtlane
        
'Associated Memory Slots => array ( '2', array ( '0xFFFF', '0xFFFF' ) ),
        '
Enabled Error Correcting Capabilities' => array ( 'None )
);

RE: Tekst edasiseks kasutuseks
Postitaja: lk_ 2015-06-28 11:32:58
https://github.com/mustangostang/spyc - ehk alustuseks aitab
RE: Tekst edasiseks kasutuseks
Postitaja: parser 2015-06-28 13:55:32
TSITEERITUD:
https://github.com/mustangostang/spyc - ehk alustuseks aitab
tänud

Leheküljed: 1

©2002-2013 Martin Rebane & PHP.ee kaasautorid
  0.0849018096924