Script to work with list of members in Facebook group

Okay, I’m now the administrator of a largish Facebook group and facing the problem of finding a particular member when I want to add them as an admin. The following script may be helpful to convert the list of all members to a delimited text file that can be imported to Excel, and used for that purpose or other metrics.


  • You can get the list of all members from the “edit officers” page.
  • My version of Excel (2002) isn’t working too well with non ASCII characters in names. If anyone knows a UTF-8 converter that could be used here (to, say, remove diacritical marks and such — we’re not dealing with huge amounts of non-ASCII data), please let me know.
  • There’s nothing but name and network here. But if you’ve got another list of stakeholders, it might be able to match your Facebook supporters with that.
  • Networks don’t show for some folks. It may be a problem with people who are in more than one network — haven’t really investigated.

# convert list of members (most recent to earliest) from a facebook group
# format
# First{additional} Last {(Network)}
# to the format
# Number:First{additional}:Last{:Network}
# where number is earliest to most recent

sed 's/make officer//' | # delete cruft
sed 's/^ *\* //' | # delete more cruft
awk '{printf "%s\t%s\n", NR,$0}' | # number lines
sort -nr | sed 's/^[0-9]*.//' | # print in order of last to first then delete numbers
awk '{printf "%s:%s\n", NR, $0}' | # renumber in the order folks joined the group, with number as first field
sed 's/ \([A-Z][^ ]*\) (/:\1:/' | # if a network, put separators before last name and network
sed 's/ \([A-Z][a-z]*\)$/:\1/' | # if no network, put separator before last name
sed 's/)//' # delete trailing ) for lines with a network

Leave a Reply

Your email address will not be published. Required fields are marked *