Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • text file editing

    Dear all,

    I have a problem that i cannot solve and I hope someone here can help me.

    I have two text files with one column of values.
    Example:

    File1:
    67
    94
    95
    .
    .

    File2
    0.1
    0.003
    0.5
    .
    .

    File1 contains the row numbers that value I need from File2. For example the output should be like this:

    Theoretical outfile:
    0.4 (row 67 from File2)
    0.5 (row 94 from File2)
    0.1 (row 95 from File2)
    etc...

    Is it possible to do this with awk?

    I would really appritiate if someone can help me.

    Thanks,
    Liy

  • #2
    solved

    awk 'FNR==NR{A[NR]=$0;next} ($0 in A){print A[$0]}' file2 file1

    Comment

    Latest Articles

    Collapse

    • seqadmin
      Latest Developments in Precision Medicine
      by seqadmin



      Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

      Somatic Genomics
      “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
      Today, 01:16 PM
    • seqadmin
      Recent Advances in Sequencing Analysis Tools
      by seqadmin


      The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
      05-06-2024, 07:48 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, Today, 07:15 AM
    0 responses
    10 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, Yesterday, 10:28 AM
    0 responses
    15 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, Yesterday, 07:35 AM
    0 responses
    16 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 05-22-2024, 02:06 PM
    0 responses
    8 views
    0 likes
    Last Post seqadmin  
    Working...
    X