Search Results

Search: Posts Made By: wanderingmind16
3,033
Posted By wanderingmind16
Thank you all. The scripts have been adjusted and...
Thank you all. The scripts have been adjusted and tested and all is fine again. It made sense to assume that only a number would need to be filled with '0's in the beginning and we changed most...
3,033
Posted By wanderingmind16
Thank you Don Cragun for the ideas. It is...
Thank you Don Cragun for the ideas.

It is so, that unfortunately many of our Scripts in HP-UNIX had simply used the %s (for example %011s) in awk-printf statements (without having to check if...
3,033
Posted By wanderingmind16
Yes, thank you Don Cragun. I posted it about...
Yes, thank you Don Cragun. I posted it about printf before I read your reply.

Is there any way I can make it compatible to the UNIX code with %s? If not, how can I tell printf to format a...
3,033
Posted By wanderingmind16
Ok, it is not just awk. UNIX>printf "%05s\n"...
Ok, it is not just awk.

UNIX>printf "%05s\n" 123
00123

Linux>printf "%05s\n" 123
123
3,033
Posted By wanderingmind16
awk treating variables differently in UNIX-Linux
Hi, awk seem to be acting differently in Unix and Linux when it comes to formatting. This is making it difficult to migrate scripts.
for example:
UNIX:

echo "123" |awk '{printf ("%05s\n"...
8,897
Posted By wanderingmind16
Thank you. I'm working on a HP-UX...
Thank you.

I'm working on a HP-UX system..The man page of join says this at the end.

STANDARDS CONFORMANCE
join: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2


and like you said,...
8,897
Posted By wanderingmind16
Thank you alister. But like i said in the...
Thank you alister.

But like i said in the first post, i already tried this with 0 and then i get this error . -o option is not taking 0. am i doing anything wrong?


join -t, -a1 -a2 -e0...
8,897
Posted By wanderingmind16
Thank you. Yes, i have tried that as well..But...
Thank you.
Yes, i have tried that as well..But then, for items not present in one file,it'll then print 0


join -t, -1 1 -2 1 -a 1 -a 2 -e 0 -o 1.1,1.2,1.3,1.4,2.3 xxx yyy
aaa,1,1,1,1...
8,897
Posted By wanderingmind16
UNIX outer join
Hello.. I am trying to join two files of about 7000 records. it looked quite straight forward when i began, but i'm not getting the desired output.
here is what i'm trying to do:

cat xxx...
1,716
Posted By wanderingmind16
Hi Scrutinizer .. Thank you for helping me...
Hi Scrutinizer .. Thank you for helping me quickly. This is working .
I misunderstood that any sort will do as long as both files are having the same sort type.


The file R2 is actually very...
1,716
Posted By wanderingmind16
Unix Join
Hi,

I am trying to join two simple files but unable to do so properly.
File R1 :
100
101
102
105
.
.
1000
10001

File R2
100|x1
102|x2
1000|a1
10001|a2

and when i do
7,029
Posted By wanderingmind16
i dont know.. maybe due to some other built-in...
i dont know.. maybe due to some other built-in vars, but i am getting it this way:

> awk 'BEGIN {
> CONVFMT="%-20.6f"
> a=30
> b=1.5
> printf ("a = %s\n",a)
> printf ("b = %s\n",b)
> c=a/b...
7,029
Posted By wanderingmind16
But this will give .000000 for an integer result...
But this will give .000000 for an integer result .. That again creates issues... :( . For whole numbers, I do not want the "." to appear in the variable value
7,029
Posted By wanderingmind16
awk calculation automatically rounding off the output
I have some calculation in my script which is similar to the below example . I find that sometimes when using large decimal digits, the output gets automatically rounded off and it is affecting the...
1,529
Posted By wanderingmind16
Oh.. Thanks a lot for that itkamaraj. :b: I need...
Oh.. Thanks a lot for that itkamaraj. :b: I need to switch to $() :)

---------- Post updated at 10:29 AM ---------- Previous update was at 10:28 AM ----------

Thank you Balajesuri...
1,529
Posted By wanderingmind16
command substitution doubt
Hi,

I almost always use back quotes in scripts to assigin output of a command to a variable.
eg: file=`basename a/b/c/d/file`
year_mon=`date +%Y%m`

But the same can be achieved...
2,691
Posted By wanderingmind16
Thanks a lot Scrutinizer and Rangarasan:b:
Thanks a lot Scrutinizer and Rangarasan:b:
2,691
Posted By wanderingmind16
Thanks.. I did a random check and it looks to be...
Thanks.. I did a random check and it looks to be working perfectly.. Could you please tell me what the "!A[$4]++ does ?

Thanks again..
2,691
Posted By wanderingmind16
remove duplicates based on a field and criteria
Hi,

I have a file with fields like below:

A;XYZ;102345;222
B;XYZ;123243;333
C;ABC;234234;444
D;MNO;103345;222
E;DEF;124243;333


desired output:

C;ABC;234234;444...
Showing results 1 to 19 of 19

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