|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I want to copy a particular word which is inside the 2nd and 4th set of square brackets "[ ]" from a text file and insert the results into a new text file having each words separated by pipes "|".
e.g. I have a text file input.txt which contains 4 line of text below: user[1] = [Mike] group = [b] role = [Designer] user[2] = [Peter] group = [a] role = [Supervisor] user[3] = [Ben] group = [c] role = [Checker] user[1] = [Mike] group = [b] role = [Supervisor] I want to create a new text file output.txt which contains 3 line of text below: Mike|Designer|Supervisor Peter|Supervisor Ben||Checker Could someone tell me the unix or shell command to do this? Any help will be appreciated. |
|
#2
|
||||
|
||||
|
__________________
~James [Not currently seeking freelance work] Like philosophy or interested in spirituality? Philosophorum. Game Dev Experts Forums Foresight Linux - Because your desktop should be cool! Linux FAQ FedoraFAQ UbuntuGuide |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Unix commad help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|