The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-13-2008
ratheesh ratheesh is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 2
Question Need help to format a file

Hi All,
I am new to the unix scripting part . can some one help to to format file with required fields.

current file looks like ..


aaa Fibre aaa aaa 01C1:01C9
1CB
01CD
01CF
1249
bbb Fibre bbb bbb 01D1
0722
072A
124A
ccc Fibre ccc ccc 01D9
124B
ddd Fibre ddd ddd 01E1
eee Fibre eee eee 01CA
0201
0209
0211
0219
0221
0229
0231
fff Fibre fff fff 0178:0185
0189
0191
107E
1246

The output file required is



aaa Fibre aaa aaa 01C1:01C9
aaa Fibre aaa aaa 01CB
aaa Fibre aaa aaa 01CD
aaa Fibre aaa aaa 01CF
aaa Fibre aaa aaa 1249
bbb Fibre bbb bbb 01D1
bbb Fibre bbb bbb 0722
bbb Fibre bbb bbb 072A
bbb Fibre bbb bbb 124A
ccc Fibre ccc ccc 01D9
ccc Fibre ccc ccc 124B
ddd Fibre ddd ddd 01E1
eee Fibre eee eee 01CA
eee Fibre eee eee 0201
eee Fibre eee eee 0209
eee Fibre eee eee 0211
eee Fibre eee eee 0219
eee Fibre eee eee 0221
eee Fibre eee eee 0229
eee Fibre eee eee 0231
fff Fibre fff fff 0178:0185
fff Fibre fff fff 0189
fff Fibre fff fff 0191
fff Fibre fff fff 107E
fff Fibre fff fff 1246

Thanks in advance ..