Search Results

Search: Posts Made By: prkfriryce
16,881
Posted By prkfriryce
i'm just doing something simple now: if...
i'm just doing something simple now:

if (!$_) {
next;
} else {
...

wanted to see how else it can be done. thanks again for the help :b:
16,881
Posted By prkfriryce
nice, what id I have missing lines or columns in...
nice, what id I have missing lines or columns in the data. What is the syntax to shift to next element/key if one is missing while still separating by every new line?

IE:
12x3.12z34b.342sd3.sds...
16,881
Posted By prkfriryce
How can I generate this data as an array of...
How can I generate this data as an array of hashes?

12x3.12z34b.342sd3.sds 454.23.23.232 aSDGgsOds
4z3x3.134b.332sSSsd3.Ccsds 354.23.2113.232 aSDffGgds
12x333.123ww4b.342sed3.sdsO...
16,881
Posted By prkfriryce
exactly... thanks! :b:
exactly... thanks! :b:
16,881
Posted By prkfriryce
sorry i meant 'undetermined, but finite number of...
sorry i meant 'undetermined, but finite number of rows' ;)
16,881
Posted By prkfriryce
multidimensional array in perl
i'm trying to open a file with three or more columns and an undetermined, but finite number of rows. I want to define an array for each row with each element of the row as a sub array. The columns...
40,782
Posted By prkfriryce
I agree as well, but sometimes perl packages are...
I agree as well, but sometimes perl packages are not always installed if you are running stripped down OSes.
40,782
Posted By prkfriryce
thanks, just tried an awk example that works for...
thanks, just tried an awk example that works for the first character as well

bash-2.03$ echo test |awk '
BEGIN { upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lower = "abcdefghijklmnopqrstuvwxyz"
}
{...
40,782
Posted By prkfriryce
replace first character of string sed
I want to change the first/or any character of a string to upper-case:

String:

test

Desired results:

Test or tEst or teSt or tesT

thanks
Forum: Solaris 06-28-2007
5,384
Posted By prkfriryce
nm, just add the admin file in the argument as...
nm, just add the admin file in the argument as well:

pkgadd -r /home/user/response -a /home/user/admin -d /home/user/xyz.pkg

:D
Forum: Solaris 06-22-2007
5,384
Posted By prkfriryce
pkgadd pkgask still prompts for user input
I create a succesful pkgask 'response' file:
pkgask -r xyz.pkg
I then attempt to use the 'response' file with pkgadd:

pkgadd -nr /home/user/response -d /home/user/xyz.pkg

the prompts for...
3,015
Posted By prkfriryce
nm, figured it out using the '[N]ext newline'...
nm, figured it out using the '[N]ext newline' syntax:

sed '/^abc\(.*\)/ {
N
N
s/abc\(.*\)/abc jkl mno\
abc pqr stu\
abc vwx yz/
}' xxx.file
3,015
Posted By prkfriryce
this is the syntax I have been attempting: ...
this is the syntax I have been attempting:

sed -e '/<abc>/!1/abc\(.*\)/jkl mno/d' -e '2/abc\(.*\)/pqr stu/d' -e '3/abc\(.*\)/vwx yz/d' xxx.file

where 'pqr stu' and 'vwx yz' would be the 2nd and...
3,015
Posted By prkfriryce
replace 2 identical strings on different lines
I am looking to replace two or more strings on different lines using sed, but not with the same variable. IE

# cat xxx.file
<abc>
abc def ghi
abc def ghi
abc def ghi
currently I can only...
6,150
Posted By prkfriryce
YES! this works. thanks everyone
YES! this works.

thanks everyone
6,150
Posted By prkfriryce
i still need to perform an action for each of...
i still need to perform an action for each of those lines. IE

for each line awk outputs, do action A,B,C.
6,150
Posted By prkfriryce
both yield the same result: ef:ghi:jk ...
both yield the same result:

ef:ghi:jk
lm:nop
qrs
ef:ghi:jk
lm:nop
qrs
ef:ghi:jk
lm:nop
qrs
ef:ghi:jk
lm:nop
qrs

Regardless of the awk output, the 'for loop' logic still interprets...
6,150
Posted By prkfriryce
Expected/desired output: # for x in `awk...
Expected/desired output:

# for x in `awk 'sub($1" +"$2" +","",$0) ' filename`; do echo $x; done
ef:ghi:jk lm:nop qrs
ef:ghi:jk lm:nop qrs
ef:ghi:jk lm:nop qrs
ef:ghi:jk lm:nop qrs
...
6,150
Posted By prkfriryce
need for loop to include fields as one line
another question that could possibly be answered with awk...

#cat filename
ab cd ef:ghi:jk lm:nop qrs
ab cd ef:ghi:jk lm:nop qrs
ab cd ef:ghi:jk lm:nop qrs
ab cd ...
2,503
Posted By prkfriryce
yeah works well, a little too well! i was...
yeah works well, a little too well! i was looking for a more simplified version by printing the fields individually, but the 'sub' syntax is what i was looking for. I'll tweek it for future...
2,503
Posted By prkfriryce
I'm gonna use sed for the time being, but would...
I'm gonna use sed for the time being, but would like to know the correct awk syntax as well

cat abc | sed 's/\(.*\)xyz://' | awk -F: '{print $1,NF}'

edit*



thanks, i'll try it
2,503
Posted By prkfriryce
yet another awk field syntax question
I am trying to print the remaing fields and field numbers beginning with a field 'xyz'

#cat abc
test1:test2:xyz:test3:test4:test5

#cat def
test1:test2:test3:xyz:test4:test5

desired output...
2,055
Posted By prkfriryce
thanks bro, works well! :)
thanks bro, works well! :)
2,055
Posted By prkfriryce
using an older version of awk on Solaris 9... the...
using an older version of awk on Solaris 9... the above suggestions do not work. :(
2,055
Posted By prkfriryce
including spaces in awk output
I need to tweek my awk output:

#cat filename
ab cd ef:ghi:jk lm:nop qrs

#cat filename | awk '{ for(i=3;i<NF+1;i++) printf $i}'
ef:ghi:jklm:nopqrs
I would like the ouput to include the...
Showing results 1 to 25 of 42

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