Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • sed,head and tail dont work? very interesting.

    After some efforts, I found some error from 62107669 to 62107678 line in one fastq file1,
    and from 211806809 to 211806818 line in another fastq file2, so I decided to delete these
    lines.

    I issued the following commands,

    wc -l file1 >>fq.wc
    sed -i '62107669,62107678d' file1
    wc -l file1 >>fq.wc

    wc -l file2 >>fq.wc
    sed -i '211806809,211806818d' file2
    wc -l file2 >>fq.wc

    Unexpected, I got the fq.wc file like this,
    633538931 file1
    633538931 file1

    871708178 file2
    871708168 file2

    Obviously,sed -i didn't work in the file1 but worked well in file2,
    and I am sure for this after manual checking.


    Then I changed my command,
    head -n 62107668 file1 >file.c
    tail -n 571431253 file1 >>file.c
    Unfortunately, it seems that head can run but tail can't.

    Finally, I solved this problem using perl to read and write line by line.

    I am confused why sed and tail failed,is this phenomenon about the big number? But they work well in the file2 which has bigger number lines than file1.
    Any suggestion will be welcome, thanks.
    Last edited by hanifk; 10-07-2011, 08:50 PM.

  • #2
    Works ok for me:


    > seq 1 633538931 > t.tmp
    > wc -l t.tmp
    633538931 t.tmp
    > sed -i '62107669,62107678d' t.tmp
    wc -l t.tmp
    > wc -l t.tmp
    633538921 t.tmp

    So I suspect ... hum ... perhaps you are are on a 32-bit machine. Or perhaps you made a mistake?

    Comment

    Latest Articles

    Collapse

    • seqadmin
      Current Approaches to Protein Sequencing
      by seqadmin


      Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
      04-04-2024, 04:25 PM
    • seqadmin
      Strategies for Sequencing Challenging Samples
      by seqadmin


      Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
      03-22-2024, 06:39 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, 04-11-2024, 12:08 PM
    0 responses
    12 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-10-2024, 10:19 PM
    0 responses
    17 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-10-2024, 09:21 AM
    0 responses
    14 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-04-2024, 09:00 AM
    0 responses
    43 views
    0 likes
    Last Post seqadmin  
    Working...
    X