is there a way of using less to open a file with no word wrap, ie with horizontal scrolling? Im sure there is but 'man less > grep "wrap"' doesnt seem to bring up anything. Apologies if this is the wrong forum!
Many thanks
Jim
cunning, I can turn the \s into \n...
But it still doesnt seem to be working, is it standard error instead of standard out? In which case how do I pipe standard error?
is there a way of splitting standard out/ standard error from a script that falls over, so far I've got:
% ./scratch.pl | split
if you imagine the error was like:
asdf asdf werqwer asdfasf asdasdf
I want a way to split this up by whitespace to become:
asdf
asdf
werqwer
asdfasf
asdasdf
I...
Is it possible to use SELECT DISTINCT to use distinct on certain columns, but not on others, for example
"SELECT DISTINCT columna, columnb, columnc FROM table" would bring back all the results where columna, columnb and columnc were not all the same, and if they were it would bring back only...
Hi guys,
I am currently writing a complicated script (perl) to do something I feel I could do with one SQL command:
I have a table -
EXP_NAME ID CHANGE
A AX 234.23
A AB -23.23
A AC 22.23
B AX -43.25
B...
Hi guys
I'm trying to work out if a table exists in my database, using an object which inherits from DBI.
my $TableExists = $dbh->fetchrow_array;
if ( $TableExists = "NO") { warn "No table";}
Now my question is...surely there is a way of combining the $dbh->fetchrow_arraty into the...
I am trying to do a switch statement which analyses multiple expression:
int main(){
char str1[] = "H";
char str2[] = "B";
switch ( * str1, * str2 ){
case 'H''B':
printf("%s","YUP");
break;
case 'B''B'...
I think u misunderstand me. I only want to replace AT with NN when AT is repeated 9 or more times(hence {9,})
ie in this string ATGCACAACAATATACGAATATATATATATATATATCGTATCGC
will become this
ATGCACAACAATATACGANNNNNNNNNNNNNNNNNNCGTATCGC
do u see the difference? I only want to replace repeat...
Hi I have a long string in which I want to substitute repeated AT regions with N, ie ATATATATATATATATATAT NNNNNNNNNNNNNNNNNNNN I am having a problem doing this i have tried with tr/// which seems to mask all AT no matter how many repeats there are, and also with the s/// which behaves oddly...
HAHA I got fed up so had a brief look at some mysql and found out i can just add now() mysql funtion and do away with trying to work out the date!!!!
cheers for ure help though, I've noted the sprintf vs printf though i expect thats prob quite basic stuff :$
ok its printing fine to screen now but for some reason it still wont go into the database which remains 0000-00-00
oh and also the date has become 1900-01-00 :S
my $dateImported=(sprintf "%d-%02d-%02d",$year+1900,$mon+1,$day); #COOL CODE, BUT NOT WORKING (SHOULD RETURN INTEGER NOT STRING...
I heard that too about the security! But really I'm doing it because i had many characters to escape I expect it is more efficient than substition commands to escape the special characters
but i still cant get it to work!!!
Hmm i tried sprintf and dropping the \n ie
my ($day,$mon,$year) = (localtime)[3..5];
my $dateImported=(sprintf "%d-%02d-%02d",$year+1900,$mon+1,$day);
but unfortunately still no dice
I might look for some different code that returns current date to the variable instead of printing it to screen
I bind them because I am dumping large XML files with ' and "s in, so they need to be binded or DBI messes up (this got me for a while!) I will try getting rid of the \n, i just found the code to get the time in this format on a random forum
Hey I'm using DBI to put a date entered value into a mysql database. However I'm having problems. My date column in NOTNULL but when i enter the date (as a string) from my perl script, whilst all other columns are filled, the date entered column remains 0000-00-00. I know it is calculating the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.