Search Results

Search: Posts Made By: wxornot
1,132
Posted By wxornot
Worked like charm. Sorry for the newbie post, I...
Worked like charm. Sorry for the newbie post, I promise I learn more before next time. :)
1,132
Posted By wxornot
Simple Perl question
Hello,

I'm completely new to Perl and I'm just looking for a quick answer to some code I'm trying to come up with. I'm trying to access a website, part of the URL I want the user to be able to...
Forum: Programming 01-29-2013
1,643
Posted By wxornot
NVL isn't supported with psql according to what...
NVL isn't supported with psql according to what I've read, but your example keyed me in on how to use coalesce. This did the trick.


SELECT name,date,coalesce(value,0) FROM table;


Regards,...
Forum: Programming 01-29-2013
1,643
Posted By wxornot
Psql replace blanks with character
Well as the title describes, its a pretty straight forward problem. I have a series of psql tables where there are lots of blanks. However there is at least one column, called name, that will never...
2,119
Posted By wxornot
Simple sed variable substitution
Give the code:


set line = 2
set year = `sed -n '2p' file

while ($line < 500)

echo $line > f.txt

@ line = $line + 1
end



How do I utilize the variable $line in the code instead...
1,648
Posted By wxornot
two dimensional
I have not used two dimensional arrays before. I will look into it. thanks,

Dave
1,648
Posted By wxornot
variables
I think your right. I've search through all sorts of online documentation, and have found nothing. No big deal. Time to find a better route. :)
1,342
Posted By wxornot
setting a varialbe in PHP
This is a re-post of a previous topic. However I'm simplifying it to hopefully get a response this time.

Given the following variables:


$id = "home";
$home=array("4.8","2.3");


I want to...
1,648
Posted By wxornot
Set variable with variable
Okay, probably an easy solution, but I've given up. I want to set a variable with a variable and print it in PHP. I just can't get the syntax right. As an example:


$place["t"] = "T";
...
2,289
Posted By wxornot
not helpful
okay that post was not helpful in the least. I understand not to include perl in the string, I meant to take it out. any other help out there?
2,289
Posted By wxornot
grabbing specific column perl
Alright,

I'm new to Perl so be gentle. Given the following script:
----
open(file, "<file.txt");

@lines = <file>;
close(file);

$var = print $lines[18];
----

So I'm printing line 18...
8,102
Posted By wxornot
write page source to standard output
I'm new to PERL, but I want to take the page source and write it to a file or standard output. I used perl.org as a test website. Here is the script:

use strict;
use warnings;
use...
33,576
Posted By wxornot
well I need to grep using the string I supplied...
well I need to grep using the string I supplied in the initial post. I'm searching for a string called pd with a space after it. So I need to grep "/pd ". Parentheses alone don't work.
33,576
Posted By wxornot
grep for forward slash
How can I use grep to grab a line that contains a forward slash? I've tried:

grep "/pd " file,

Inevitably it just grabs pd not /pd.
13,586
Posted By wxornot
Looks like I was just over thinking the issue....
Looks like I was just over thinking the issue. Thanks. ;)
13,586
Posted By wxornot
set variable with another variable? c shell
okay, this shouldn't be difficult but I can't figure it out. How can I set a variable with another variable. I have the following:

foreach pe ($dir $sp)

set tpe = `echo $pe | grep M`
if ($tpe...
3,009
Posted By wxornot
thanks for the help, don't worry it isn't...
thanks for the help, don't worry it isn't homework.
3,009
Posted By wxornot
Yeah I didn't phrase my question the way I wanted...
Yeah I didn't phrase my question the way I wanted to. Let me try again.

Given the following:
----------------------
foreach var (t v w)

grep $var ./file > ./newfile

set ${var}temp = `awk...
7,139
Posted By wxornot
It doesn't matter. Personal preference i guess....
It doesn't matter. Personal preference i guess. To me the awk command is a bit complicated. It's not something you could easily come up with, unless you know it. Whereas the tr command is a bit...
7,139
Posted By wxornot
tr is like awk, sed, any other unix command. tr...
tr is like awk, sed, any other unix command. tr indicates you want to begin "translating" something to follow. What you want to translate, followed by what you want it to become, then the filename,...
7,139
Posted By wxornot
tr means translate. It's a cool function, you...
tr means translate. It's a cool function, you can translate most things from one character to another. It works like sed more or less, just one more tool to have in your unix bag of tricks.
7,139
Posted By wxornot
i would do this instead. translate the / to a...
i would do this instead. translate the / to a space. then awk the 5th field.


tr "/" " " ./file | awk '{print $5}'
3,009
Posted By wxornot
echoing two variables in one statement
I have the following
--------------------
foreach var (STO SNY WKF)

set ta = 5

end

---------

How can I echo both variables at the same time. Something to the effect of

echo...
1,997
Posted By wxornot
character spacing issue
I have a script that has a counter in it, the output from the script puts the values in columns, and when the values are greater than 9 it moves the rest of the row over, hence displacing the...
9,235
Posted By wxornot
assigning variables in sed command
I need to assign a variable within a variable in a sed command.
I tried doing the following in c shell.


set left = 1
set right = 2
set segment = qwerty

sed -n -e...
Showing results 1 to 25 of 42

 
All times are GMT -4. The time now is 07:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy