I recently purchased a NAS ethernet drive from LaCie. They are pretty cheap these days - about a hundred quid. I'm sick of finding out that I downloaded a particular file to my laptop rather than my desktop or whatever and this seemed like a good solution. It works flawlessly on the MacBook through the LaCie provided software. Less so, with the openSuSe.
I ended up installing everything in yast2 that even tangentically mentioned samba or netbios. I then opened up my firewall to the fullest extent possible, sacrificed two virgins, restarted netbios and samba a couple of times and lo and behold it worked. I then switched the firewall back on with samba and netbios selected as allowed services for the external zone and it seems happy enough with that. No real lesson learned here, just black magic. This is really just a note for other to let them know that it could in theory work.
Showing posts with label file-handling. Show all posts
Showing posts with label file-handling. Show all posts
Sunday, February 22, 2009
Friday, July 25, 2008
Count chars
We might have had this one before but I couldn't find it.
cat commafile.txt | tr -dc ',' | wc -c
That could be replaced by any file in the commfile.txt. So, basically count the number of occurrences of the expression ',' in the file and print it out. Why? you ask - cos I gotta.
cat commafile.txt | tr -dc ',' | wc -c
That could be replaced by any file in the commfile.txt. So, basically count the number of occurrences of the expression ',' in the file and print it out. Why? you ask - cos I gotta.
Wednesday, March 21, 2007
Counting the number of instances of a letter in a file
To explain why this might be necessary:
First I have an xml file with some sequences in it. I grep the xml file finding the instances I am interested in and save these to a file, stripping out the xml using vim.
I am now left with the raw text of the sequences from the xml file that I am interested in.
I can now run the following command to check out the number of times say M appears in the file;
Easy. The alternative was to write a C++ program to do all this - which would have taken considerably longer. Especially given that some people haven't committed working versions of their code. I'm looking at you Mr. TreeCreate and Mr IntVector.
First I have an xml file with some sequences in it. I grep the xml file finding the instances I am interested in and save these to a file, stripping out the xml using vim.
grep -A 5 \<type\>Dis filename.xml | grep \<sequence\> > file_raw_seq.txt
Alternatively I could use the fasta file and strip the headers using grep -v \>.I am now left with the raw text of the sequences from the xml file that I am interested in.
I can now run the following command to check out the number of times say M appears in the file;
tr -dc M < input.fa | wc -c
Easy. The alternative was to write a C++ program to do all this - which would have taken considerably longer. Especially given that some people haven't committed working versions of their code. I'm looking at you Mr. TreeCreate and Mr IntVector.
Subscribe to:
Posts (Atom)