10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What is an awk command to print only fields with a number in it??
Input file.......
S,S,S,S,S,S,S,S,S
001S,S,S,S,S,S,S,S,S
00219S,23S,24S,43S,47S,S,S,S,S
00319S,10S,23S,41S,43S,47S,S,S,S
00423S,41S,43S,46S,47S,S,S,S,S
00510S,23S,24S,43S,46S,S,S,S,S
00610S,23S,43S,46S,47S,S,S,S,S... (2 Replies)
Discussion started by: garethsays
2 Replies
2. Shell Programming and Scripting
I have the following awk script that I am using to find the max value in the file and print results.
awk 'BEGIN {MAX=-1E100} {for (x=2; x<=NF; x++) if ($x>MAX) {MAX = $x; C1 = $1}} END {print substr(C1,1,11), substr(C1,13,4), substr(C1,18,2), MAX}' ABC*
Input (ABC*)
... (6 Replies)
Discussion started by: ncwxpanther
6 Replies
3. UNIX for Dummies Questions & Answers
Hi, I'm trying to get multiple substitutions in one expression using sed:
echo "-foo-_-bar--foo-_bar_-_foo_bar_-foo_-_bar_-" | sed -e "s//-/g"
So, as you can see I'm trying to replace all instances of _-, -_, -- with - (dash)
I have provided bad example. The question is how to use multiple... (6 Replies)
Discussion started by: useretail
6 Replies
4. Shell Programming and Scripting
I have a string with the following information and want to return the number of entries enclosed by <> in awk
<stdin>: N = 441 <0.369000018/0.569000006> <0.369000018/0.569000006> <0/1> (7 Replies)
Discussion started by: kristinu
7 Replies
5. Shell Programming and Scripting
I'd appreciate the help and explaining "which each switch/command does. Thanks in advance.
1742@3min# ./fmtopo|grep serial
hc://:product-id=SUNW,Sun-Blade-2500:server-id=c3admin:serial=130B58E3146/motherboard=0/cpu=0 (2 Replies)
Discussion started by: LittleLebowski
2 Replies
6. UNIX for Dummies Questions & Answers
Hi
I want to search for a specific pattern in file
Say
ABC;HELLO_UNIX_WORLD;PQR
ABC;HELLO_UNIX_WORLD_IS_NOT_ENOUGH;XYZ
ABC;HELLO_UNIX_FORUM;LMN
Pattern to search is : "HELLO_UNIX_*****" and not "HELLO_UNIX_***_***_"
I mean after "HELLO_UNIX" there can only be one word.In this case... (2 Replies)
Discussion started by: dashing201
2 Replies
7. Shell Programming and Scripting
I need an awk script that returns the 1st field of the line in the middle of a file. For example, if a file I have has 6 lines, I want it to return the 1st field on line number 3. If a file has 7 lines, I want the script to return the 1st field on line number 4.
File1:
3 214
4 219
5 226
2... (8 Replies)
Discussion started by: jontjioe
8 Replies
8. Shell Programming and Scripting
Hello
I have the following output which is returned with the Month in text format instead of numerical. The output I receive is performed by using Rational Synergy CM software commands from the Unix command line and piping Unix commands on the end.
bash-3.00$ ccm query -n... (4 Replies)
Discussion started by: Glyn_Mo
4 Replies
9. Shell Programming and Scripting
Hey all UNIX nerds- I've built a shell script which runs pretty well- only I want it to have much better error trapping. (Like the kind I could apply to every shell script I write).
I'm not a UNIX genius, and could really use a bit of help.
The original script goes something like this:
1... (3 Replies)
Discussion started by: stevekerver
3 Replies
10. Shell Programming and Scripting
Hi all, i am doing a perl script to read from a db. I am able to retrieve the rows, but i am unable to return the number of rows selected. i tried
$selectedrows = $sth->numrows; i got the error msg:
Can't locate object method "numrows" via package "DBI::st"
i changed it to $selectedrows =... (7 Replies)
Discussion started by: new2ss
7 Replies