- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: By saying site1, site4 i assume you mean all of their values like: site1: A N N A G N site4: G G G N C C But could you please elaborate how exactly you get this result? | |
Hello everyone, i am fairly new to shell scripting so please bear with me. The following script is supposed to read words from a file and depending on the word print different things. However it always prints the default value. It also refuses to work completely if the first line … | |
Re: I just tested this on Windows and the replacement works without a problem. However not escaping the ''s when using '"' seems to cause a lot of problems. Try escaping all your ''s. | |
Re: It looks like you just need someone to write a script for you. Otherwise you would have presented your attempt to solve this problem. IIRC daniweb is not here to do your homework or normal work for you. In other words: Present some code or go pay someone to do … | |
Re: [CODE]$s =~ s/{{.+}}//sg; # removes everything $s =~ s/({{|}})//sg; # just removes the tags[/CODE] Seems to be working fine for me unless you meant something different. | |
Re: Something like this? use strict; use warnings "all"; my @ip; open my $IN, "<csv.txt" or die "cannot open file to read.\n"; while(<$IN>) { @ip = split(",", $_); } close $IN; foreach(@ip) { print "$_\n"; } We read the data from a file and then loop through it. | |
Re: If you only want to put the content of all those files into one i'd do that as follows: use strict; use warnings "all"; my @files = qw(Seq1.txt Seq2.txt Seq3.txt); open my $out, ">>output.txt" or die "Cannot open output.txt\n"; foreach my $file (@files) { open my $in, "<$file" or die … | |
Re: My best guess is the filehandle holds all the data that has been read until you write. Looks like you might have to either find a different way or just read it in first and the write it again. EDIT: after looking around for a bit it seems to be … | |
Re: I just tested your script under Win7x64 and it only produces the headers (BSC BCF DATE TIME SAHA ALARM) but nothing else. Instead of chasing down some obscure bug related to the windows OS it should be faster to just run this under Linux/some sort of VM, as the script … | |
Re: The way i see it the code that sends out the mail is already there (line 81-105). You also have all the values since they are read in the beginning (line 33-45). So you could write a function that contains the mail code and then just pass the parameters to … | |
Re: Here's what i found regarding this topic. Maybe it can help you out. use strict; use warnings "all"; open my $IN, "<in.txt" or die "cannot open file.\n"; my $timer = 0; my $_loc = -s $IN; seek($IN, $_loc, 0); while(1) { if($timer >= 25) { die "No new lines added … | |
Re: It would be nice if you post some code so we can help you with any problems you ran into. Did you try to just read in the files split them and then compare them? | |
Re: I don't see how to match 010 twice but you could match 010 and 10 by using /.*?10/. | |
Re: Something like this? {M,N} Denotes the minimum M and the maximum N match count. [code] $string1 = "Hello World\n"; if ($string1 =~ m/l{1,2}/) { print "There exists a substring with at least 1"; print "and at most 2 l's in $string1\n"; } [/code] | |
Hello everyone, assuming i want to write some values into my database of choice i found two ways to do this. [CODE] my $sql = "INSERT INTO table (foo, bar, foobar) VALUES (?, ?, ?)"; my $sth = $dbh->prepare($sql); foreach(sort keys %hash) { $sth->execute($_, $hash{$_}, $some_other_value); } [/CODE] as opposed … | |
Re: You want something like this? [CODE="Perl"] my @a = split(/\s/, $str); say "$a[0]$a[1]$a[2]"; [/CODE] | |
Re: you need to use "my" when you first declare a variable and use strict :) EDIT: oh nvm i was too late^^" | |
Re: "There is an error" or "it does not work" are not very accurate descriptions of a problem. Try to explain the problem so people can help you. | |
Re: I can recommend SFML it's fairly easy to use and has lots of tutorials. [url]http://www.sfml-dev.org/[/url] | |
Hey everyone, i've been trying to send some words seperated by spaces to a server and only the first word arrives. The connection stuff is all fine but i have absolutely no idea whatsoever how to make it send more than one word at once. This is what i'm talking … | |
Hi everyone, as said in the title i have a _very_ basic IRC bot that keeps disconnecting after a few seconds. This is what i have so far and i'm grateful for every hint you might have. I also checked this thread but it did not really help: [url]http://www.daniweb.com/forums/thread243489.html[/url] [code] … | |
hi everyone, how can i react on a plugged in usb drive? (e.g. show a messagebox or whatever when a usb drive is plugged in) The whole thing needs to run under windows only (xp and maybe vista) | |
Hi everyone, i wrote this small app and it works fine but it erases everything up to the offset and everything after it. Anyone knows how to avoid that? [CODE=C++]#include <iostream> #include <fstream> int main() { int hex = 0x75; std::ofstream f("sample.exe", std::ios::binary); f.seekp(1169, std::ios::beg); f.write(reinterpret_cast<const char *>(&hex), 2); f.close(); … | |
Re: Watch out for more entries that say Version in your *.rc file and change them all to the Version you want. That works for VC++ 6 maybe it still works in the newer versions. | |
Hi everyone, as the heading already says i want to check whether a folder is a network share or not. So far i tried to achieve this by reading the file attributes but that did not lead to the right solution. If anyone here knows how to do this please … |