| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
sed 's|;|\n|g' yourfile |sed -r
';n;n;s|[A-Z]+|\L\u\0|g;n;n;n;n;n;n;n;n;n;n;n;' |sed
'N;N;N;N;N;N;N;N;N;N;N;N;N;N;s|\n|;|g'
... not sure, if I can count to 15 correctly ;-)
On 10/12/15 10:10, MOKRANI Rachid [email protected] [sed-users] wrote:
> Thanks.
>
> I dont' use GNU sed. Daniel solution work great on simple file.
>
> My file has 15 colums, the separator is ; and the names to convert are in the third colum.
>
>
>
>
> -----Message d'origine-----
> De : [email protected] [mailto:[email protected]]
> Envoyé : mercredi 9 décembre 2015 20:11
> À : [email protected]
> Objet : Re: upper/lower case
>
> If helpful, here is Thierry's solution #1, for one column (the data you sent), the sed script just formatted a little differently.
>
> $ cat input.txt
> PAUL
> JEAN-CHARLES
> MARIE ODILE
>
> $ sed -r "s/(.*)/\L\1/; s/\<(.)/\u\1/g" input.txt Paul Jean-Charles Marie Odile
>
> For the case with multiple columns, if Thierry's solution #2 does not work, you might send an input file and desired output.
>
> Daniel
>
> On 12/9/2015 2:33 AM, MOKRANI Rachid [email protected] [sed-users]
> wrote:
>> Hi,
>>
>> I own a file with multiple columns, and in one column there are names which are all in uppercase.
>>
>> Example :
>> PAUL
>> JEAN-CHARLES
>> MARIE ODILE
>> ...
>> ....
>>
>> I would like to get a result like.
>> Paul
>> Jean-Charles
>> Marie Odile
>>
>> How to do that very simply with sed/awk easy to get this result?
>>
>>
>> Many thanks for your suggestion.
>> Regards.
>> __________________________
>> Avant d'imprimer, pensez à l'environnement ! Please consider the environment before printing !
>> Ce message et toutes ses pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. IFP Energies nouvelles décline toute responsabilité au titre de ce message. This message and any attachments are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP Energies nouvelles should not be liable for this message.
>> __________________________
>>
>>
>> ------------------------------------
>> Posted by: MOKRANI Rachid <[email protected]>
>> ------------------------------------
>>
>
> ------------------------------------
> Posted by: Daniel Goldman <[email protected]>
> ------------------------------------
>