Search Results

Search: Posts Made By: Chirel
1,605
Posted By Chirel
Hi, Maybe it's not a space but another...
Hi,

Maybe it's not a space but another character, you could try
mget *testfile
1,095
Posted By Chirel
Hi, maybe this could work for you. awk ' ...
Hi, maybe this could work for you.


awk '
BEGIN { print "create service_group TEST"; }
{ print "create service_group TEST \x27\x27 services:tcp"$1 }' port.txt
6,852
Posted By Chirel
Hi, Use quote when you compare variables in...
Hi,

Use quote when you compare variables in case one is empty;

So use :
5,779
Posted By Chirel
Hi, Try this Src_dt="Aug 15, 2012...
Hi,

Try this

Src_dt="Aug 15, 2012 02:00:03"
Tgt_dt="Aug 14, 2012 18:00:03"
Total=$(expr $(date -d "$Src_dt" +%s) - $(date -d "$Tgt_dt" +%s))
echo $Total | awk '{printf "Elapsed time:...
772
Posted By Chirel
Hi, Just to be sure, could you paste some...
Hi,
Just to be sure, could you paste some examples lines from input file ?

The code should be something like

{
# X = column number
array[$X]++;
}
END {
for ( x in array ) {
...
966
Posted By Chirel
Hi, If what you want is to compare line 1 of...
Hi,

If what you want is to compare line 1 of each file then line 2 of each file etc, then the code is wrong.
The code you show compare line 1 of file1 with all lines of file2 and then same for...
4,178
Posted By Chirel
Hi You have empty lines in the files that's...
Hi

You have empty lines in the files that's why you have comma in the "wrong" place.
To add the count and have the output you want change the code to

perl -lane '$c{"$F[4] $F[5]"}++;...
14,146
Posted By Chirel
Hi Maybe that's what you mean ? $...
Hi
Maybe that's what you mean ?


$ Table_1=tbl1_c1
$ Table_2=tbl2_c1
$ Query='$Table_1 Join $Table_2'
$ echo $Query
$Table_1 Join $Table_2
$ eval echo $Query
tbl1_c1 Join tbl2_c1
15,486
Posted By Chirel
Hi, command A >outa <outa command B...
Hi,


command A >outa
<outa command B >outb
<outb command C >outc
cat >script.awk <<"EOF"
{print $1 $2 $3 $4 $5}
EOF
awk -f script.awk outc
2,252
Posted By Chirel
You are right i forgot about those Solaris...
You are right i forgot about those Solaris limits.

Maybe this should work then :


find . -newer filename -exec perl -e "\$fname=\"{}\";"'$mtime=(stat($fname))[9]; printf("%ld...
2,252
Posted By Chirel
Hi By the way, you can't use -exec ls -lrt...
Hi

By the way, you can't use -exec ls -lrt to sort the find output, because ls will be called for each file, so it will only sort the given file.

You should sort after the find process, maybe...
1,422
Posted By Chirel
Hi awk -v srch="^# Prod Sybase" -v...
Hi

awk -v srch="^# Prod Sybase" -v line="1.1.1.1 blah" '{ if (match($0,srch)) { print; getline; print; print line; } else print }' /etc/hosts
1,213
Posted By Chirel
Hi sure i can awk ' ...
Hi

sure i can

awk ' ## Let's call awk
{ ## For each line of the file
if (match($0,/Campbell/)) ## Test if the word Campbell is in...
13,809
Posted By Chirel
I'm sorry but it's not possible with csplit to...
I'm sorry but it's not possible with csplit to cut every 500 sequences. If it's lines you can, but sequences no.

I think you should go for an awk or perl or sed or other solution to you problem.
...
15,330
Posted By Chirel
Nice one :) So it's find . -type f -exec wc...
Nice one :)

So it's find . -type f -exec wc -c {} \; | awk '{s+=$1} END {print s}'
1,213
Posted By Chirel
Hi Something like that ? awk '{if...
Hi
Something like that ?

awk '{if (match($0,/Campbell/)) print; else { if (p) print p; p=$0 } } END {if (p) print p}' songs
15,330
Posted By Chirel
Hi give a try to find . -maxdepth 1 -type...
Hi

give a try to
find . -maxdepth 1 -type f -exec stat -c "%s" {} \; | awk '{s+=$1} END {print s}'

You can remove the -maxdepth 1 if you want to add the subdir contents.
13,809
Posted By Chirel
Hi Try this csplit -s -f part INFILE.fasta...
Hi

Try this
csplit -s -f part INFILE.fasta '/^>/' {*}

This should create lot's of partxx files.
8,799
Posted By Chirel
Hi, a regex will match something, then what...
Hi,

a regex will match something, then what ?
If don't understand what do you mean by a regex to process on the fly dynamically. .

Can you give me an exemple please ?

The goal even if it's...
907
Posted By Chirel
Well done Ranga :) ps for fun : awk...
Well done Ranga :)

ps for fun :

awk '/^[0-9]/ {a[$2]++;b[$2" "$3]++;}END . . . .
8,799
Posted By Chirel
Hum i guess that when i write in english it's not...
Hum i guess that when i write in english it's not clear. So let's talk regex

i said :


That could mean something like : '\.\w[A-Z]'
792
Posted By Chirel
Hi, i just can guess that you forgot to...
Hi,

i just can guess that you forgot to quote the variable while using it like that "$A2"

But we don't have the script so it's not easy to reply.
8,799
Posted By Chirel
Hi, The input & output of what you want is...
Hi,

The input & output of what you want is not clear for me, but about parsing full-stop.

Maybe you could say that full-stop must be followed by a \w and a capital letter or end of file ?
907
Posted By Chirel
Hi, Alister you are right, even if this...
Hi,

Alister you are right, even if this solve the problem it's not user friendly, so here is the readable version :)

First take only company name and the A/B status and we sort them


# awk...
907
Posted By Chirel
Hi, awk '/^[0-9]/ { print $2,$3}'...
Hi,


awk '/^[0-9]/ { print $2,$3}' input-file | sort | uniq -c | awk 'BEGIN{print "Company Count A B"} {if (comp && comp != $2) { printf("%-10s %5d %3d...
Showing results 1 to 25 of 157

 

Featured Tech Videos

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