Search Results

Search: Posts Made By: angshuman
2,551
Posted By angshuman
Thank you all for your reply. As suggested by...
Thank you all for your reply. As suggested by RudiC, I have changed my script to use another file instead of pre-defined array. Here is the code used:



awk -F',' 'NR==FNR { a[$1]=$2; next } $2...
2,551
Posted By angshuman
Replace Value of nth Column of Each Line Using Array
Hello All,

I am writing a shell script with following requirement:

1. I have one input file as below


CHE01,A,MSC,INO
CHE02,B,NST,INC
CHE03,C,STM,INP


2. In shell script I have...
4,926
Posted By angshuman
How to use absolute function?
Hello All,

I am using following awk command in my shell script. I want to compare the value in column 2 and colum 3 after taking their absolute value. Column $2 and $3 can have any value positive...
1,639
Posted By angshuman
Hello RudiC, Sorry if my question is not...
Hello RudiC,

Sorry if my question is not clear. Let me rephrase as below:

Replace value of column 5 of a line with value of column 4 of previous line provided value of column 5 is zero and...
1,639
Posted By angshuman
Sorry. What do you mean by rest?
Sorry. What do you mean by rest?
1,639
Posted By angshuman
Following should be the output: ...
Following should be the output:


1757890237|42|55570025|1468796400|1471474800
1757890237|32|55570025|1471474800|1474153200
1757890237|54|55570025|1474153200|1476745200...
1,639
Posted By angshuman
Copy Column Value Of Next Line Into Current Line
Hello All,

I am looking for help to achieve the following:

Here is the data set


1757890237|42|55570025|1468796400|0
1757890237|32|55570025|1471474800|0...
4,581
Posted By angshuman
Thank you Akshy for the help. It worked...
Thank you Akshy for the help.

It worked perfectly.
4,581
Posted By angshuman
Convert Second Column Date Into EPOCH Time And Print Complete Row
Hello Team,

I am stuck in getting the required output in the following case. Please help.

My input file is


aa|08/01/2016
bb|08/15/2016


I wish to convert the file into


aa|epoch...
2,457
Posted By angshuman
Thank you Stomp. Now here is my understanding....
Thank you Stomp. Now here is my understanding. Please correct me if wrong:

1. awk scans each row of the file.
2. It stores entire row in d[$1$4"_1" and column to compare in d[$1$4"_2"
3. After...
2,457
Posted By angshuman
Hello Ravinder, Sorry this time also it did...
Hello Ravinder,

Sorry this time also it did not work. I am using enterprise Linux and awk version is GNU awk 3.1.5

Hello stomp,

Your try worked for me. I need to understand the code that you...
2,457
Posted By angshuman
Hello Ravinder, Thank you for your help. In...
Hello Ravinder,

Thank you for your help. In your code, you have used $2. Are you referring to field 2 by $2? If yes, I think it should be $6. Because I wish to find the row where $6 is greater...
2,457
Posted By angshuman
Filter Row Based On Max Column Value After Group BY
Hello Team,

Need your expertise on following:

Here is the set of data:


C1|4|C1SP1|A1|C1BP1|T1
C1|4|C1SP2|A1|C1BP2|T2
C2|3|C2SP1|A2|C2BP1|T2
C3|3|C3SP1|A3|C3BP1|T2...
1,889
Posted By angshuman
Thank you Ravinder for your response. Sorry if I...
Thank you Ravinder for your response. Sorry if I question is not clear.

Condition 1 - Unique value of column one which are 3330690 and 0640829
Condition 2 - Unique value of column one 3330690 is...
1,889
Posted By angshuman
Count occurrence of column one unique value having unique second column value
Hello Team,

I need your help on the following:

My input file a.txt is as below:


3330690|373846|108471
3330690|373846|108471
0640829|459725|100001
0640829|459725|100001...
11,329
Posted By angshuman
Convert date in dd mm yyyy format to UNIX timestamp
Hello All,

I have a date in DD/MM/YYYY format. I am trying to convert this into unix timestamp. I have tried following:


date -d $mydate +%s

where mydate = 23/12/2016 00:00:00



I am...
4,209
Posted By angshuman
Thank you Ivo. I have used your idea and it...
Thank you Ivo. I have used your idea and it helped.
4,209
Posted By angshuman
Hello RudiC, I modified the script as per my...
Hello RudiC,

I modified the script as per my requirement but it failed to give output. I did not understand the part "tries to assign a string composition of FILENAME and fields 1 and 3 to array A...
4,209
Posted By angshuman
Hello RudiC, I have used following comparing...
Hello RudiC,

I have used following comparing my requirement with example given in the thread. It did not work for me.

Here is the command:


awk -F, 'FNR==NR{A[$2 OFS $3]=FILENAME"."$1 OFS...
4,209
Posted By angshuman
Joining Two Files Matching Two Columns
Hi All,

I am looking to join two files where column 1 of file A matches with column 1 of file B and column 5 of files A matches with column 2 of file B. After joining the files based on above...
1,069
Posted By angshuman
Formatting Read Command
Hi All,

I am using HP Unix and trying to write a script in menu style. At the end of list, I will accept the input from keyboard and take action accordingly. Uptill here it is ok. However, I want...
1,282
Posted By angshuman
Hi Akshay, Thank you for your help. It...
Hi Akshay,

Thank you for your help. It worked. Can you please help to understand following part of the code:

substr($0,1,index($0,$4)-1)


Thanks
Angsuman
1,282
Posted By angshuman
Need to maintain in- and output format with awk
Hi All,

I have a data file (myfile.txt) as below:


- A H C
- A HHH F
- AAA HH I


The importan point is that the width between the columns are not fixed and the...
Forum: HP-UX 01-25-2014
2,536
Posted By angshuman
Environment Variables
Hi All,

I need to understand following three environment variables and their usages in HP Unix.



_M_ARENA_OPTS
_M_CACHE_OPTS
PTHREAD_SCOPE_SYSTEM



How does these environment...
912
Posted By angshuman
How To Arrange Record In A Special Order?
Hi All,

I have following data to be arranged based on columnd 6:


0098442947
0098222107
0098442134
0098200179
0098441067
0098442744
0098443106
0098442746
0098321411
0098443111...
Showing results 1 to 25 of 76

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