[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] quiza para algun guru de sed o perl [FIX]



Supongo que será porque es por la mañana... Este es el script bueno:

#/bin/sh
if [ ! -f "$1" ] ; then
echo "El archivo especificado no existe."
exit 1
fi
cat $1 | col -x | tr -s " " | \
awk '{ \
 if (NF != 10 && NF != 11) next;
 printf $1 (NF == 10 ? "," : " ") $2 ","
 printf $3 "," $4 "," $5 "," $6 "," $7 "," $8"," $9 "," $10;
 if (NF == 11) printf "," $11;
 printf "\n";
}'

Me habia dejado un campo, perdon.

---------------------------------------------
Arnau Carrasco - http://www.arnaucarrasco.com
---------------------------------------------



Reply to: