Question
Assuming the file phone.txt has the following records { 1=2547475485 2=2547200001 3=1610821059 4=0 7=1 8= 9= 16=1 20=3613261515 605=xxcd21190f0e6c8a0f1 1509=Off 1510= } { 1=2547475432 2=2547218977
Assuming the file phone.txt has the following records { 1=2547475485 2=2547200001 3=1610821059 4=0 7=1 8= 9= 16=1 20=3613261515 605=xxcd21190f0e6c8a0f1 1509=Off 1510= }
{ 1=2547475432 2=2547218977 3=2210821022 4=0 7=1 8= 9= 16=1 20=9213261533 605=rt5321190f0e6c8a0f1 1509= 1510=On
}
{ 1=2547479872 2=2547212456 3=3310821033 4=0 7=1 8= 9= 16=1 20=8813261588 605=Arte21190f0e6c8a0f1 1509= 1510=On }
Write a shell script to extract fields of the file within each curly braces and record it in a csv file.
- The only variables to be extracted in the file are below 1,2,3,20,605,1509 and 1510. - The columns to be created in excel are only for the above specified fields and should have the header name as below 1 - MT 2 - MO 3 - A/C 20 - SN 605 - MAC 1509 - Offnet 1510 - Onnet The rows recorded in the excel/csv should have records as per below manually inputted data from the file.
Below is the desired output. MT MO A/C SN | Offnet Onne 2547475485 2547200001 1610821059 3613261515 xxcd21190f0e6c8a0f1 Off 2547475432 2547218977 2210821022 9213261533 rt5321190f0e6c8a0f1 On 2547479872 2547212456 3310821033 8813261588 Arte21190f0e6c8a0f1 On Below is the desired output. MT MO A/C SN | Offnet Onne 2547475485 2547200001 1610821059 3613261515 xxcd21190f0e6c8a0f1 Off 2547475432 2547218977 2210821022 9213261533 rt5321190f0e6c8a0f1 On 2547479872 2547212456 3310821033 8813261588 Arte21190f0e6c8a0f1 On
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started