Hi,
I am having an input file which contains a group of words,if one specific word comes which goes to next line.
example:
input file===>
shashi country= india comapny= none shashi shashi company= NONE shashi=my name
output===>
shashi country= india comapny= none
shashi
shashi company= NONE
shashi=my name
could you help me to write a small shell program..
thanks in advance..
# awk 'gsub(/ shashi/,"\nshashi")1' file
shashi country= india comapny= none
shashi
shashi company= NONE
shashi=my name
sed 's/ \(shashi\)/\n\1/g' filename
-Devaraj Takhellambam
Hi,
both commands given the not correct answer...
uid=ERTCHWE | eriMasterDomain=EAPAC | eriCountry=Taiwan, | ou=ERT
uid=ERTSYWU | eriCountry=Taiwan, | ou=ERT | uid=ERTKESU | eriMasterDomain=EAPAC
| eriCountry=Taiwan, | ou=ERT
uid=ERTSEYU | eriMasterDomain=EAPAC | eriCountry=Taiwan, | ou=ERT
uid=ERTWSY | eriMasterDomain=EAPAC | eriCountry=Taiwan, | ou=ERT
uid=EILRAAL | eriMasterDomain=EAPAC | eriCountry=India | ou=EIL
=======================
each uid will start from a new line..
thanks in advance...
then why didn't you post a correct sample in the first place.????
where is your code? show it so that we could correct for you.
sorry for that..
here is the input=>
uid=ERTCHWE | eriMasterDomain=EAPAC | eriCountry=Taiwan, | ou=ERT
uid=ERTSYWU | eriCountry=Taiwan, | ou=ERT | uid=ERTKESU | eriMasterDomain=EAPAC
| eriCountry=Taiwan, | ou=ERT
uid=ERTSEYU | ou=ERT |uid=ERTWSY | eriMasterDomain=EAPAC | eriCountry=Taiwan, | ou=ERT
uid=EILRAAL | eriMasterDomain=EAPAC | eriCountry=India | ou=EIL
=======
out put should be
=========>
uid=ERTCHWE | eriMasterDomain=EAPAC | eriCountry=Taiwan, | ou=ERT
uid=ERTSYWU | eriCountry=Taiwan, | ou=ERT
uid=ERTKESU | eriMasterDomain=EAPAC| eriCountry=Taiwan, | ou=ERT
uid=ERTSEYU | ou=ERT
uid=ERTWSY | eriMasterDomain=EAPAC | eriCountry=Taiwan, | ou=ERT
uid=EILRAAL | eriMasterDomain=EAPAC | eriCountry=India | ou=EIL
====
thanks in advance..
clx
7
you can modify the source string in any of the above soln.