Re: [Trisquel-users] how to work with plain text

2018-01-15 Thread Adonay Felipe Nogueira
Simple example using GNU Sed: printf '01:00AM\nReceived from Ana\n02:00 PM\n03:00 AM\nReceived from Bob\n' | sed 's/[AP]M/\0\n\n/g; s/Received from/\n\n\0/g' For safety purposes, sed doesn't replace the contents of the file, unless you pass `-i' to it. 2017-12-09T23:24:47+0100 a...@ncf.ca

Re: [Trisquel-users] how to work with plain text

2017-12-09 Thread masonhock
Tested in Pluma, but other text editors should work similarly: Use "find and replace" (Ctrl+H in Pluma). Make sure "Parse escape sequences" is checked. - replace "AM" with "AM\n\n" - replace "PM" with "MP\n\n" - replace "Received from" with "\n\nReceived from"

[Trisquel-users] how to work with plain text

2017-12-09 Thread adel
Hi friends I have a big plain text (.txt) file that I would like to edit in the following ways: 1. after every "AM" or "PM, insert two "Enter"s (line breaks .. like if this were HTML) 2. before every "Received from", insert two "Enter"s There might be a hundred to three hundred of