PLEASE NOTE: the upgrades to this server,, have not yet been completed.
Hopefully the changes will be completed on THURSDAY 8th December.
Web-based programs, such as csmarks, cssubmit, and the help fora, will be unavailable at some time on Thursday 8th.
  It's UWAweek 49


This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 564 articles.
Currently 2 other people reading this forum.

 UWA week 16 (1st semester, non-teaching week) ↓
SVG not supported

Login to reply

2:24pm Mon 18th Apr, Ryan B.

Hi Peter,

As we've discussed in the labs, there are multiple ways to 'skin the Unix cat', so it is entirely possible you have completed the assignment conditions without sed.

The reason that I advocate (in this particular instance) for the use of sed over tail can be tested locally at your end:

  • Currently, the presence of the U+EFF/BOM at the beginning of the file leads to your method producing a list of words, with the first line being empty (likely, the result of the BOM).
  • If you were to be given a file without the BOM (or you use the sed technique above to remove it if it exists, or you create your own test file), does this still produce an empty line at the top of the list of words?
  • If it does not produce that empty line, then the use of tail +2 (a la. the labs with the CSV headers) is going to affect your results, as you will be skipping a word, rather than an empty line.

I should note that when I mention the use of sed, I am not suggesting permanently editing the files in-place - rather, as is the case in various pre-processing scenarios, I can create an intermediary file (maybe $FILENAME.edit), do my operations on that, and then remove that edited file once the analysis has been done.

I hope that clarifies things.

Warm Regards,


The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy