Page 8

COMMAND & CONQUER

The third expression can be translated as “Find all letters followed by a 1 or 2 digit number, followed by a slash, and insert the semi-colon.” The only column that contains a slash is our formatted date column – this applies therefore to the column before it (Project). The reason why I didn't include numbers in this case, is because the second expression could handle this if you tell Sed to accept any number of spaces after the 3 digits. This handles column 2 in our file. The fourth expression handles the last line of the file, and inserting the 3 semi-colons before tasks. It essentially groups the entire line (1 0 tasks) and then inserts three semi-colons before that group. If you're adding semicolons before any lines starting with numbers, then you should move this expression to the start of the list of expressions, so Sed doesn't match it.

The fifth expression simply states “Find the line that starts with any number of capital letters, and insert a space afterwards”. I go a little more specific, and state “followed by any number of spaces and more letters”. However, it's

not necessary in our example, and is simply there to be a bit more robust. That about covers the steps I undertook in this scenario. I realize that this is a relatively specific occasion, and not everyone will want to have this exact formatting. My hope is that following my process will help you understand how to approach these sorts of problems. If it's wished for, I can spend an article focusing on short formatting problems, and working through it step by step. If anyone is interested in that sort of article, please let me know via email. As always, any questions/concerns or requests can be directed to me at lswest34+fcm@gmail.com.

LIBREO FFICE SPECIAL EDITIONS:

http://fullcirclemagazine.org/libreofficespecial-edition-volume-one/

http://fullcirclemagazine.org/libreofficespecial-edition-volume-two/

http://fullcirclemagazine.org/libreofficespecial-edition-volume-three/

I NKSCAPE SPECIAL EDITIONS:

Lucas has learned all he knows from

repeatedly breaking his system, then having no other option but to discover how to fix it. You can email Lucas at: lswest34@gmail.com.

full circle magazine #81

http://fullcirclemagazine.org/inkscapespecial-edition-volume-one/

8

http://fullcirclemagazine.org/inkscapespecial-edition-volume-two/ contents ^

Full Circle Magazine #81  

This month: * Command & Conquer * How-To : Python, LibreOffice, and Improve Security with Lynis . * Graphics : JPG>PDF, and Inkscape. * Revi...

Full Circle Magazine #81  

This month: * Command & Conquer * How-To : Python, LibreOffice, and Improve Security with Lynis . * Graphics : JPG>PDF, and Inkscape. * Revi...

Advertisement