Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Scifi9547

  1. Scifi9547

    Find the minimum value in a column of an array

    Hi I have a file with data like this. -1 2 ereu 1 2 rerer 2 2 rere 3 2 eee 3 2 wwwe 9 2 qqewew 9 2 vvvgf -1 2 wwwew 4 3 wwew -9 3 wwss 6 3 jjuu 7 3 kkii 7 3 ggtyu 8 3 ffder 1 4 rrtrr 1 4 rree If the values in 2nd column are same, calculate the minimum value in the first column and print...
  2. Scifi9547

    Challenging Awk Array problem

    Hi, I rather have a very complicated awk problem here, at least to me. I have two files. File 1: 607 687 174 0 0 chr1 3000001 3000156 -194195276 - L1_Mur2 LINE L1 -4310 1567 1413 1 607 917 214 114 45 chr1 3000237 3000733 -194194699 - L1_Mur2 LINE L1 -4488 1389 913 1 607 215 31 0 30 chr1...
  3. Scifi9547

    Filtering the lines by field similarity

    Feherke, Annihilannic, and PHV - Thank you very much brothers. Its working perfectly. You rock!
  4. Scifi9547

    Filtering the lines by field similarity

    The actual file is very big (1.4GB with 8 million lines). I did not post even a sample here because it might have looked very complex. ANyhow, I am posting first fewlines here: 2|1,23,8,NM_175153,chr9:64808744-64812188 +...
  5. Scifi9547

    Filtering the lines by field similarity

    ///Sorry, my mistake. It should be FS=OFS=",", not RS=ORS=",". /// Thank you very much. Its working perfectly. I have a related question. I have another table but with 19 columns. 2|1,23,8,mm9,+,682,13,0.70,1.0,-1,6,18,28,40,cga,cga,|||,13,13 I want the same function to be performed as...
  6. Scifi9547

    Filtering the lines by field similarity

    ///Then type gawk -f least.awk input.file at the command prompt./// Thanks again. The script is working. But the out put is not what I expected. The out put is coming like this: 0.5 25 ,1.2 37 ,1.7 34 ,2.3 37 ,3.0 37 ,0.2 25 , But I need an out put like below: 25,AGH,0.2 34,TUY,3.0...
  7. Scifi9547

    Filtering the lines by field similarity

    ///What OS/platform are you doing this on? You may need to use nawk instead of awk.//// I am using windows XP professional. I copied and pasted in the script and tried and it did not work. I use gawk.
  8. Scifi9547

    Filtering the lines by field similarity

    @feherke THanks a lot for the code, but it doesn't seem to work. it runs but doesnt print anything. What am I missing here? thanks
  9. Scifi9547

    Filtering the lines by field similarity

    oops - small correction Here is the input file *same as the above except with an additional line at 5. Lines 5,6.7 have same field 1, but i need to isolate only lines 6 and 7 because they have same least field 3 values (1.2). 25,AGH,0.2 25,GHT,0.5 25,jsw,1.7 34,TUY,3.0 37,KJJ,2.3 37,KJU,1.2...
  10. Scifi9547

    Filtering the lines by field similarity

    Hi folks. I have data something like this: 25,AGH,0.2 25,GHT,0.5 25,jsw,1.7 34,TUY,3.0 37,KJU,1.2 37,KJT,1.2 The logic I want to input here is that IF field 1 of lines are same, then isolate the line with the least field 3 value in to a new file. For example - lines 1,2,3 have same field 1...

Part and Inventory Search

Back
Top