Remove new lines from a text file
Posted: 2019-10-08 Filed under: office | Tags: line, sed, space, tr Leave a commentI want to copy some text from a PDF file into a word processor. Copying works, but the line breaks from the PDF formatting are also copied. This messes up the text and results in disconnected text with many rows. I decided to use the command line to fix this automatically. I searched a bit and it seems that there are two steps that have to be taken.
Read the rest of this entry »
Cleaning up with sed 2
Posted: 2017-07-08 Filed under: academic | Tags: clean, fasta, grep, sed, sequence Leave a commentI have a list of nucleotide sequences in fasta format, obtained from NCBI. I want to clean the sequences names, leaving only the accession numbers. Additionally, I want to extract the accession numbers to a separate list. I am not that familiar with sed
, since I use it mainly in my SlackBuilds to fix small things. Therefore, for my fuuture reference, I decided to sum things up.
Read the rest of this entry »
Cleaning up with sed
Posted: 2017-03-31 Filed under: academic | Tags: clean, phylogenetic tree, phylogeny, SeaView, sed, TimeTree, txt Leave a commentI needed to clean up some plain text files from data and characters I did not want.
To be more precise, I have a phylogenetic tree, obtained from the TimeTree web-site. Species presented there are mainly birds, several reptiles and a fish. The tree has branches length information and node labels, which I wanted to remove.
Read the rest of this entry »
Making a patch
Posted: 2016-11-26 Filed under: slackbuilds | Tags: diff, patch, sed Leave a commentI usually fix the SlackBuilds I maintain by sed
, as it makes things much more transparent. However, sed
is not always an option, especially for some big fixes or fixes that contain “weird” characters, for example something like this:
unless (defined(@$slist) && defined($hlist_sel)) {
The above is an excerpt from perlprimer.pl
, that had to be fixed. The problem in question has been discussed here. I wanted to provide a fix for my perlprimer.SlackBuild, therefore I decided to make a patch.
Read the rest of this entry »