Search Results

Search: Posts Made By: msabhi
8,496
Posted By elixir_sinari
Check my earlier post now. $ cat mach.pl ...
Check my earlier post now.
$ cat mach.pl
#!/usr/bin/perl

if (-t STDIN) { die "Input from terminal not allowed\n" }

while( defined($line = <STDIN>) ) {
chomp($line);
print...
29,875
Posted By scottaazz
the unix command "head" is made for that type of...
the unix command "head" is made for that type of operation. Use the following operation.

to remove the last two line of a file use:

head -n-2 yourfile
4,172
Posted By elixir_sinari
Hi msabhi, perl does have a file rename operator,...
Hi msabhi, perl does have a file rename operator, if you'd forgotten about it.
3,550
Posted By jim mcnamara
IF you start testing methods on a file be aware...
IF you start testing methods on a file be aware of the effect file caching by the OS and disk controllers. You will get completely bogus results if you are not aware of this. I/O wait time is the...
2,939
Posted By lancesunny
Thanks
Thanks msabhi. You been very helpful.
1,072
Posted By Scrutinizer
Everything in awk has the form condition{action}....
Everything in awk has the form condition{action}. If the condition evaluates to 1 then the action is performed. If the condition is omitted then the default condition is 1, so the action is always...
881
Posted By rdrtx1
./master.pl '$333'
./master.pl '$333'
2,039
Posted By elixir_sinari
The pattern START will, of course, match START3....
The pattern START will, of course, match START3. What strings do you want to match?
------

awk '/START3/{p=1}p' file
1,717
Posted By alister
No, it did not. You just did not notice the...
No, it did not. You just did not notice the error. A comma is still allowed even though it's not on your list of allowed characters.

The portions highlighted in red represent ranges of characters,...
4,776
Posted By Chubler_XL
How about this update: awk ' ...
How about this update:

awk '
FNR!=NR&&FNR==1 {
printf "MSISDN,IMSI,STATE,NAM"
PROCINFO["sorted_in"] = "@ind_str_asc"
for(i in tags) printf ",%s", i;
printf...
3,015
Posted By Lord Spectre
Thanks for your effort msabhi, unfortunately both...
Thanks for your effort msabhi, unfortunately both commands doesn't work and the response from oracle is still in two lines!
But hey! Don't waste more time ;) , I'll put the result in one line from...
1,853
Posted By Scrutinizer
Or sed: sed 's/\(..:..:..\)\.0/\1/g' infile ...
Or sed:
sed 's/\(..:..:..\)\.0/\1/g' infile

(the . before the 0 should be escaped)
2,298
Posted By Don Cragun
Try this: awk 'FNR == NR { # Accumulate records...
Try this:
awk 'FNR == NR { # Accumulate records from 1st file.
f1[++n1] = $0
low1[n1] = $4 - 100
mid1[n1] = $4
high1[n1] = $4 + 100
next
}
{ #...
3,838
Posted By Don Cragun
[/quote]That almost works. You don't need (or...
[/quote]That almost works. You don't need (or want) the asterisk in a call to gsub(). It matches every string of zero or more matches, which in this case effectively adds a space before any of the...
896
Posted By elixir_sinari
awk -F\| 'BEGIN{OFS=FS}...
awk -F\| 'BEGIN{OFS=FS} {gsub(/,/,q","q,$2);sub(/^/,q,$2);sub(/$/,q,$2)}1' q=\' infile
4,007
Posted By Franklin52
Try: awk -F, 'NR==FNR{a[$1];next}$1 in a' file2...
Try:
awk -F, 'NR==FNR{a[$1];next}$1 in a' file2 file1
Showing results 1 to 16 of 16

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