Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help with BASH/AWK queries .... Post 302479123 by Fahmida on Thursday 9th of December 2010 11:57:29 PM
Old 12-10-2010
Thanks inlib!!!

Actually the first solution (for loop option) works better and I've used that.
Just need a bit more work to wrap it up.
Now each of the output files look like this:

outfile1.txt
Code:
contig00052  length=535   numreads=10
GGGCTGACGTGGCCGCTAATACGACTCACTATAGGGAGAGGGATGTCCACAGGCAGAGGg
ATgtCCAca
contig00065  length=713   numreads=27
GGGgCTGACGTGgCCGCTAATACGACTCACTATAGGgAGAGGTTACATTGTCTTTGGAGT
GTATTGTT
contig00038  length=622   numreads=32
GGGCTGACGTGGCCGCTAATACGACTCACTATAGGGAGAGAAGCACGCTGGGAAGGGATA
GAAATTGCTAAAC

Now I want to replace the header part so that:
Code:
'contig00052  length=535   numreads=10'  will become  '>Header_1'
'contig00065  length=713   numreads=27'  will become  '>Header_2'
'contig00038  length=622   numreads=32'  will become  '>Header_3'

and the final output would look like:
Code:
>Header_1
GGGCTGACGTGGCCGCTAATACGACTCACTATAGGGAGAGGGATGTCCACAGGCAGAGGg
ATgtCCAca
>Header_2
GGGgCTGACGTGgCCGCTAATACGACTCACTATAGGgAGAGGTTACATTGTCTTTGGAGT
GTATTGTT
>Header_3
GGGCTGACGTGGCCGCTAATACGACTCACTATAGGGAGAGAAGCACGCTGGGAAGGGATA
GAAATTGCTAAAC

It'll be good if I can assign any 'Header Number'. For example, instead of, Header_1, Header_2, Header_3 ... I can start from Header_50, Header_51_Header_52 ... i.e. they'll follow an incremental order from the starting 'Header number'.

Last edited by Scott; 12-12-2010 at 06:41 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Some queries...

Guys need some advice on how to check some of the questions below? i'm running on an open VMS platform... which i am an idiot to... appreciate if anyone can give some hints or source on how to check on.. a script that is running on cron job... but doesn't run as the login user name.. 1. why... (6 Replies)
Discussion started by: 12yearold
6 Replies

2. UNIX for Advanced & Expert Users

Two small queries

Query 1 : How to check if a directory already exists? If doesn't exist then create a new one. Query 2 : I want to put following text using a single echo statement into a log file and also want to retain the formatting of the text. How it can be... (3 Replies)
Discussion started by: skyineyes
3 Replies

3. Shell Programming and Scripting

my queries

hi guys Well, i need to have a report generation script or any script which will show me all the content/information of a file when i run that script. Please help me on this isssue at the earliest.As i am little bit aware of scripting.Thanks in advance! regards ash (4 Replies)
Discussion started by: whizkidash
4 Replies

4. Homework & Coursework Questions

Queries

Any help on like where to get started on this? I'm just confused. 1. The problem statement, all variables and given/known data: Enter text here.Queries to satisfy these two report requests (use your CCI database): Retrieve all rows of active inventory where current on hands is less than... (0 Replies)
Discussion started by: lakers34kb
0 Replies

5. UNIX for Advanced & Expert Users

awk script queries

Hi, First query: I am trying to execute the below command to pull all the record whose length is not of the expected. But this is not giving the expected results. $2 is the record length passed in the script as second parameter.$filename is the filename on which the awk is executed.It is... (4 Replies)
Discussion started by: devina
4 Replies

6. Shell Programming and Scripting

Few queries regarding awk...

One of the command output is as below. -rw-r--r--+ 1 root root 75G Nov 21 16:43 /var/ovs/mount/86BXXX/running_pool/Machine1/System-sda.img -rw-r--r--+ 1 root root 75G Nov 21 16:36 /var/ovs/mount/86BXXX/running_pool/Machine2/System.img -rw-r--r--+ 1 root root 150G Sep 23 19:13... (2 Replies)
Discussion started by: pinga123
2 Replies

7. UNIX for Advanced & Expert Users

How many DNS queries

Is there any way to see how many queries come into our external DNS server? In looking at DNS providers, most of them base pricing on number of queries per month so I just wanted to see if you had any idea/way of gathering that data? A rough ballpark figure would even work. Our DNS server is... (1 Reply)
Discussion started by: raggmopp
1 Replies

8. UNIX for Dummies Questions & Answers

FTP Queries

Hi, 1) How to get exact permissions, group names for files while transferring with FTP 2) Is there any command to transfer entire directory and sub directories. Thanks (1 Reply)
Discussion started by: nag_sathi
1 Replies

9. Debian

GRUB Queries ?!

Hello, I am posting the following questions here because I need them answered by people who have actually done a lot of work in GRUB. DO NOT GIVE ME GUESS ANSWERS PLEASE. Feel free to redirect me if this is not the right place to ask these questions. Can I download GRUB separately from... (6 Replies)
Discussion started by: sreyan32
6 Replies

10. IP Networking

RDNS Queries

Hey everyone, I have a question, I've been playing around with tcpdump, and noticed my machine making numerous rdns look ups. They are displayed like: 10.80.80.141.51234 > 10.80.80.1.domain: 9950+ PTR? 223.114.55.65.in-addr.arpa. (44) My question is, if dns works based on numerical... (0 Replies)
Discussion started by: Lost in Cyberia
0 Replies
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy