Please help me with this code. I have 2GB file to process and shell seems to be the best option. I am a biologist and though I can think of the logic, the commands are beyond me. Any help is greatly appreciated. Please look at the attched file and the requirement will be very clear.
I want to count rows from file2 which match columns from file 1 and group the rows.
1) FILE 1 : col 1 and 3 has to be matched with FILE 2:col 1 and 2.
2) When condition1 is satisfied, I need to count and separate rows in FILE:1 belonging to group1 or group 2.
Compare FILE 1 :col 3 to FILE 2 : cols 3 and 4, if they are of different lengths then
trim the last character from FILE1 col3 and compare.
If it matches with FILE2:col 3, then increment group 1.
If it matches with FILE2:col 4, then increment group 2.
If it does not match any, assign it to grp1 or grp2 whichever has the value blank,if none of the two is blank then ignore that row.
3) Do steps 1 and 2 for each value of FILE:1 col 2.
The string "random" in the attached file can be any non-blank string.
Moderator's Comments:
Removed attachment, moved content below - no need to attach a file for just 934 bytes
Last edited by Scott; 11-11-2011 at 06:39 PM..
Reason: Removed attachment
I have huge log file that taken every minute
and I need the total at 5min intervals.
Sample log:
#timestamp(yyyymmddhhmm);result;transaction
201703280000;120;6
201703280001;120;3
201703280002;105;3
201703280003;105;5
201703280004;105;5
201703280005;105;4
201703280006;120;2... (2 Replies)
Good evening
I have the below requirements, as I am not an experts in Linux/Unix and am looking for your ideas how I can do this.
I have file called file1 and file2.
I need to get the second column which is text1_random_alphabets and find that in file 2, if it's exists then print the 3rd... (4 Replies)
At the top of the XYZ file, I need to insert the ABC data value of column 2 only when ABC column 1 matches the prefix XYZ file name (not the ".txt"). Is there an awk solution for this?
ABC Data
0101 0.54
0102 0.48
0103 1.63
XYZ File Name
0101.txt
0102.txt
0103.txt
... (7 Replies)
Hi,
I hope somebody can help me with this problem, since I would like to solve this problem using awk, but im not experienced enough with this.
I have two files which i want to match, and output the matching column name and row number.
One file contains 4 columns like this:
FILE1:
a ... (6 Replies)
I have a file like:
I would like to find lines lines with duplicate values in column 1, and retain only one based on two conditions: 1) keep line with highest value in column 3, 2) if column 3 values are equal, retain the line with the highest value in column 4.
Desired output:
I was able to... (3 Replies)
Please help me with commands for the following file operations
File description
5 columns in total , sorted by column 1 value
First formatting,
1) Records with duplicate column 1 values are to be ignored. Just consider the first occurrence of such a record.
2) Records with (column 2 -... (3 Replies)
I have this huge log file on my linux box that gets generated every day. I'm able to extract the information I need; however I really would like it to be broken down every 10mins.
Log File Snippet
01:23:45 MARYHADA Maryhadalittle.lamb(): fleece as white as snow 1394 for and everywhere that... (8 Replies)
Hi Guys,
I have a file in UNIX with duplicates, I have use sort command as below to delete duplicates based on the KEY positions/columns but now I do not want to "delete" duplicates but summarize by KEY numeric columns.
REALLY NEED HELP... URGENT!!!
Thanks in advance.
sort -k 1.1,1.92... (6 Replies)