May you explain me please why the field separator is a double "[]" and not only one?
It is not double, I just specified field separators ][inside [ ]
Quote:
Originally Posted by Ophiuchus
And how it works this part ? {sub(/\..*$/,X,$2);A[$2]++}
(/\..*/,X,$2) means substitute period . followed by zero or more occurrence of any character .* in $2 value with X (which is undefined variable and hence NULL)
A[$2]++ means create an associative array A indexed by the previously modified 2nd field value and array value is incremented.
I'm a little bit confused. The original posting in this thread said that only entries from 01 Aug 2013 were to be considered, but the ouput from Yoda's script has an entry (shown in red below) from August 2nd:
and it doesn't include output corresponding to the input line:
because there is a leading space on this line.
Did I misunderstand the requirements? Would the following more accurately produce the desired results?:
It produces the output:
The line in red is not produced by Yoda's script.
As always, if you're using a Solaris/SunOS system, use /usr/xpg4/bin/awk, /usr/xpg6/bin/awk, or nawk instead of /bin/awk or /usr/bin/awk.
Hi,
I have the following input in a file & need output as mentioned below(need counter of every occurance of field which is to be increased by 1).
Input:
919143110065
919143110065
919143110052
918648846132
919143110012
918648873782
919143110152
919143110152
919143110152... (2 Replies)
Hello All,
I got a requirement when I was working with a file. Say the file has unloads of data from a table in the form
1|121|asda|434|thesi|2012|05|24|
1|343|unit|09|best|2012|11|5|
I was put into a scenario where I need the field count in all the lines in that file. It was simply... (6 Replies)
Dear Friends,
I am sorting the file which contain 55Lakhs of records while Sorting i am facing issues
Sort :0653-657 Write Error occured while merging
Could you please any one tell me how to overcome this problem
Thanks in advance (5 Replies)
Hello
I have some hpux 11.23/31 systems ,and some other (linux,solaris)
I know if i want change the mtu size ,need use lanadmin.
But:if i try on 11.23 : ifconfig lan1 mtu 8000,system paniced.
If i try on 11.31 :ifconfig lan1 mtu 8000,remove ip address from interface.
Ithink is not a best... (1 Reply)
I have a script which archives log file events which are 90-days old. Script works fine but I wanted some input on one aspect of this script. My nawk statement, bolded below, that removes events 90-days prior from today, I need it to find anything 90-days or older. The log file date pattern looks... (0 Replies)
Hi All,
In my application, I'm getting an error as type mismatch
Let me now explain the scenario,
I ran a shell script which calls some other scripts. All these scripts uses the environment variables.
Take for example, this script uses a variable 'PathDir'. I initiallized the value to... (2 Replies)
We had written an application in which we create worker thread.
So the main thread will create the worker thread. After some time
the child thread(Worker thread) will call pthread_exit().
This function was written in try{} and there occured an Exception
and is handled in catch(...)... (0 Replies)
hi,
cud u help me to find this.
i hav 2 files.
file1 has data as "ARUN
ARUN is from Australia
Arun likes America etc..
ARUN ARUN "
file2 has "ARUN
Australia
America"
i... (5 Replies)