MOKRANI Rachid rachid.mokrani@ifpen.fr [sed-users]
2017-06-01 16:08:05 UTC
Hi,
I think it's very simple, but I don't find how to do it.
cat A.txt :
Mme;Sylvie;Blue;Paris;FR
Mr;Dan;Green;New-York;USA
Mr;David;Allen;Cannes;France
#!/bin/bash
for f in $(cat A.txt | awk -F ";" '{print $2"+"$3}') ;
do
echo "$f" | tr '[:upper:]' '[:lower:]'
done
OK, the result is :
sylvie+blue
dan+green
david+allen
But I want to add the result at the end of the each line of the file A.txt
Need result in a new file B.txt :
Mme;Sylvie;Blue;Paris;FR;sylvie+blue
Mr;Dan;Green;New-York;USA;dan+green
Mr;David;Allen;Cannes;France;david+allen
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.
__________________________
[Non-text portions of this message have been removed]
I think it's very simple, but I don't find how to do it.
cat A.txt :
Mme;Sylvie;Blue;Paris;FR
Mr;Dan;Green;New-York;USA
Mr;David;Allen;Cannes;France
#!/bin/bash
for f in $(cat A.txt | awk -F ";" '{print $2"+"$3}') ;
do
echo "$f" | tr '[:upper:]' '[:lower:]'
done
OK, the result is :
sylvie+blue
dan+green
david+allen
But I want to add the result at the end of the each line of the file A.txt
Need result in a new file B.txt :
Mme;Sylvie;Blue;Paris;FR;sylvie+blue
Mr;Dan;Green;New-York;USA;dan+green
Mr;David;Allen;Cannes;France;david+allen
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.
__________________________
[Non-text portions of this message have been removed]