I really fancy the performance achieved while reading a stream line by line using file separator IFS and read -r option. For example assume you have a phone list like the below:
NAME SURNAME PHONE
john|smith|+44.............
ali|veli|+90..........
...
carlos|suarez|+34..............
You can process the file with the below script line by line having name surname and phone numbers separated.
cat phonelist | while IFS="|" read -r V1 V2 V3; do echo "Name:$V1 Surname:$V2 Phone:$V3";done
Its really fast compared to reading line by line and using awk for processing the lines.
Everything about my Hands-On Software Engineering experience and collection of interesting posts from Software Industry.
Bu Blogda Ara
23 Eylül 2012 Pazar
23 Ocak 2012 Pazartesi
9 Ocak 2012 Pazartesi
4 Ocak 2012 Çarşamba
15 Kasım 2011 Salı
Kaydol:
Kayıtlar (Atom)