Search Results

Search: Posts Made By: msabhi
8,570
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...
30,040
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,337
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,585
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,962
Posted By lancesunny
Thanks
Thanks msabhi. You been very helpful.
1,085
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...
2,090
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
923
Posted By rdrtx1
./master.pl '$333'
./master.pl '$333'
1,780
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,816
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,075
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,916
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,432
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,960
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...
928
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,168
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 02:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy