Search Results

Search: Posts Made By: shamrock
802
Posted By shamrock
Can you post what you've tried to solve...
Can you post what you've tried to solve this...and what about records that are less than the current date
1,069
Posted By shamrock
Good catch...so here's the updated awk recipe: ...
Good catch...so here's the updated awk recipe:
awk '{if($NF==0 || $NF+0) print $NF}' file
2,545
Posted By shamrock
What do you mean by an empty file...a file with...
What do you mean by an empty file...a file with size zero bytes or one that is filled with zeros?
1,895
Posted By shamrock
No need for the while loop...first remove...
No need for the while loop...first remove everything that follows the comma on each line of the pattern file with awk and pipe its output to grep...
awk -F, '{print $1}' pattern_file | xargs grep {}...
804
Posted By shamrock
Hopefully this sed one liner might work... sed...
Hopefully this sed one liner might work...
sed -e 's/\([0-9]\)\([A-Z]\)/\1 \2/g;s/\([a-z]\)\([A-Z]\)/\1 \2/g;s/\([A-Z]\)\([A-Z]\)\([a-z]\)/\1 \2\3/g;s/^\([0-9]*\) //' file
4,202
Posted By shamrock
I get the desired output by tweaking the FS in...
I get the desired output by tweaking the FS in your "first awk"...
awk -F"\"[,:]* *\"*" '{
for (i=1; i<NF; i++) {
if ($i ~ "path") print $(i+1)
else if ($i ~ "Sample Name")...
1,561
Posted By shamrock
Then why dont you post a sample of the exact...
Then why dont you post a sample of the exact input that is to be worked on...please dont expect us to read your mind :confused:
2,137
Posted By shamrock
So what is to be done with those lines that have...
So what is to be done with those lines that have neither intronic or exonic in them?
Forum: Programming 02-26-2016
2,410
Posted By shamrock
You can convert decimal to binary using...
You can convert decimal to binary using bc...there is no need to write a special C program...
echo "obase=2;1234" | bc
1,885
Posted By shamrock
Post a sample of the input and desired...
Post a sample of the input and desired output...because imo this can all be done with a single nawk without the need for a pipe...
14,758
Posted By shamrock
Yet another way of doing the same thing with...
Yet another way of doing the same thing with awk...
awk -F"[ ]" '{for(i=1;i<=NF && ($i=="");i++);print "there are "i-1" spaces leading upto " $i}' file
2,985
Posted By shamrock
Yet another way of doing the same thing with...
Yet another way of doing the same thing with awk..
awk -F\| '{OFS="|";gsub(",",RS$1FS,$2);print}' file
7,370
Posted By shamrock
@OP: we are at a point where it is pointless to...
@OP: we are at a point where it is pointless to proceed unless you post the contents of the makefile...your env is setup properly but there is something in your makefile that is erroneous so unless...
1,869
Posted By shamrock
Any reason to insist on grep instead of sed or...
Any reason to insist on grep instead of sed or awk for parsing your input...
sed 's/\(.*>\)\(.*\)\(<.*\)/\2/g' file
or
awk -F"[<>]" '{print $3}' file
1,595
Posted By shamrock
If you have perl already then it should be pretty...
If you have perl already then it should be pretty simple to solve this problem...
8,623
Posted By shamrock
Can you post what the desired output should look...
Can you post what the desired output should look like...
1,390
Posted By shamrock
This should work albeit untested... awk...
This should work albeit untested... awk '{for(i=1;i<=NF;i++) if($i ~ "^(IN|OUT)$") print $3,$i,$(i+1)}' file
1,327
Posted By shamrock
Give this perl script a try... ...
Give this perl script a try...

#!/usr/bin/perl

use Time::Local;

while (<>) {
@f = split /\|/, $_;

($y1, $o1, $d1) = (substr($f[3], 0, 4), substr($f[3], 5, 2), substr($f[3], 8,...
1,246
Posted By shamrock
Store all hostnames in a file ("servers" for...
Store all hostnames in a file ("servers" for example)...

cat servers
aaaa
cccc
dddd

Run the awk script on "InputFile.txt" to get the desired output separated by criteria into different...
2,636
Posted By shamrock
Change the echo to print...
Change the echo to print...
3,036
Posted By shamrock
That was specific to your question as you were...
That was specific to your question as you were looking for 4 patterns and if you want something generic then take out the n...

---------- Post updated at 12:59 PM ---------- Previous update was at...
3,036
Posted By shamrock
Well you could give this [g]awk a try... ...
Well you could give this [g]awk a try...

gawk '{
for (i=1; i<=NF; i++)
if ($i ~ "^(error|fail|panic|accepted)$")
a[$i]++
} END {
for (i in a) {
n++
...
2,307
Posted By shamrock
Not sure what you're looking for...can you be...
Not sure what you're looking for...can you be more clear about your requirements...
1,265
Posted By shamrock
That is correct...you cant embed variables in a...
That is correct...you cant embed variables in a /regexp/...
1,426
Posted By shamrock
That's because uniq expects its input to be...
That's because uniq expects its input to be sorted...so that duplicate lines are adjacent to each other...in fact uniq can be eliminated by using the "-u" option to sort...
sort -u test.txt | grep...
Showing results 1 to 25 of 147

 

Featured Tech Videos

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