Sponsored Content
Top Forums Shell Programming and Scripting sed command removes lines in file Post 302533560 by neutronscott on Friday 24th of June 2011 04:27:59 AM
Old 06-24-2011
awk alternative.
Code:
awk '$0 ~ /^SCORE=/ { $0="SCORE=" } 1' scores.txt >newfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using sed command to replace multiple lines

the file contains the follwoing lines /* * Copyright (C) 1995-1996 by XXX Corporation. This program * contains proprietary and confidential information. All rights reserved * except as may be permitted by prior written consent. * * $Id: xxx_err.h,v 1.10 2001/07/26 18:48:34 zzzz $ ... (1 Reply)
Discussion started by: radha.kalivar
1 Replies

2. Shell Programming and Scripting

sed command to get the total lines

hi, I am using the following code to get the first field of all the lines in a file using sed command.But its not printing the last line.Why it is so and how can i read the different fields of each line ? code: for i in $(sed = filename.txt | sed 'N;s/\n/ /' | cut -d " " -f1) do val1=`sed... (5 Replies)
Discussion started by: Sharmila_P
5 Replies

3. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

4. UNIX for Dummies Questions & Answers

Sed to remove only first line erroneously removes last line too

Hello everyone, This is my first posting. I have read the rules of this forum. I have searched many various threads and haven't found one that applies to my situation or suggestions to fix the issue. I do appreciate the help. I am trying to execute a basic UNIX script in a Solaris... (4 Replies)
Discussion started by: dqrgk0
4 Replies

5. UNIX for Advanced & Expert Users

perl/sed -i removes link

hello, is it a behavior of or that "-i" removes unix link . example : i create a file "src_file" and link it to "link_file" and then i start "perl -i" the link is removed. does another option exists to change content of a file without temporary files ? UNIX-Version: HP-UX and... (2 Replies)
Discussion started by: bora99
2 Replies

6. Shell Programming and Scripting

sed command to condense two lines into one

My eyes glaze over trying to understand multiline sed commands, so please forgive me if this has been asked before. I'd like to condense the following two lines: fooPATTERN1 PATTERN2bar into the following one line: foobar How is that done in sed? (7 Replies)
Discussion started by: scolfax
7 Replies

7. Shell Programming and Scripting

Sed: removes \ from text which causes issues

Hi all, Hoping someone hoping someone might be able to help. i've got the following sed command which i'm using in a bash script that i'm trying to use to insert a new line into an already existing file so i don't have to manually enter it when setting stuff up. the existing script test2/3 are... (3 Replies)
Discussion started by: springs2
3 Replies

8. UNIX for Dummies Questions & Answers

Sort command -u removes non-unique item

I am wondering why the sort command removes the volume with 0 in it, but orders everything else. I have a list like this: cat list1 /vol/list_vol0 /vol/list_vol1 /vol/list_vol2 /vol/list_vol3 /vol/list_vol4 /vol/list_vol5 /vol/list_vol6 /vol/list_vol7 /vol/list_vol8 /vol/list_vol9... (2 Replies)
Discussion started by: newbie2010
2 Replies

9. UNIX for Dummies Questions & Answers

sed command to Insert a line before the last four lines of the file

By using sed command, How to insert a new line before the last four lines of the file. Old Line Old Line NEW LINE! Old Line Old Line Old Line Old Line (8 Replies)
Discussion started by: wridler
8 Replies

10. Shell Programming and Scripting

sed or awk removes attachment in email

Hi We have a requirement to send email using shell script.email should have html body and pdf attachment. We used uuencode for attaching files and sendmail option to acheive and it is working fine. However custoemr wants to make body of email slightly dynamic. E.g dear customer in html file... (3 Replies)
Discussion started by: Harish7586
3 Replies
PARSEBLAST(1)						      General Commands Manual						     PARSEBLAST(1)

NAME
parseblast - Filtering High-scoring Segment Pairs (HSPs) from WU/NCBI BLAST. SYNOPSIS
parseblast [options] <results.from.blast> DESCRIPTION
This manual page documents briefly the parseblast command. Different output options are available, the most important here are those allowing to write HSPs in GFF format (GFFv1, GFFv2 or APLOT). Sequences can be included in the GFF records as a comment field. Furthermore, this script can output also the alignments for each HSP in ALN, MSF or tabular formats. NOTE - If first line from blast program output (the one containing which flavour has been run, say here BLASTN, BLASTP, BLASTX, TBLASTN or TBLASTX), is missing, the program assumes that it contains BLASTN HSP records. So that, ensure that you feed the parseblast script with a well formatted BLAST file. Sometimes there are no spaces between the HSP coords and its sequence, as it sometimes happens in Web-Blast or Paracel-Blast outputs. Now those records are processed ok and that HSP is retrieved as well as "standard" ones. WARNING - Frame fields from GFF records generated with parseblast contain BLAST frame (".","1","2","3") instead of the GFF standard values (".","0","1","2"). As the frame for reverse strand must be recalculated from the original sequence length, we suggest users to post-process the GFF output from this script with a suitable filter that fix the frames (in case that the program that is going to use the GFF records will not work with the original BLAST frames). We provide the command-line option "--no-frame" to set frames to "." (meaning that there is no frame). OPTIONS
parseblast prints output in "HSP" format by default (see below). It takes input from <STDIN> or single/multiple files, and writes its out- put to <STDOUT>, so user can redirect to a file but he also could use the program as a filter within a pipe. "-N", "-M", "-P", "-G", "-F", "-A" and "-X" options (also the long name versions for each one) are mutually exclusive, and their precedence order is shown above. GFF OPTIONS: -G, --gff Prints output in GFFv1 format. -F, --fullgff Prints output in GFFv2 "alignment" format ("target"). -A, --aplot Prints output in pseudo-GFF APLOT "alignment" format. -S, --subject Projecting GFF output by SUBJECT (default by QUERY). -Q, --sequence Append query and subject sequences to GFF record. -b, --bit-score Set <score> field to Bits (default Alignment Score). -i, --identity-score Set <score> field to Identities (default Alignment). -s, --full-scores Include all scores for each HSP in each GFF record. -u, --no-frame Set all frames to "." (GFF for not available frames). -t, --compact-tags Target coords+strand+frame in short form (NO GFFv2!). ALIGNMENT OPTIONS: -P, --pairwise Prints pairwise alignment for each HSP in TBL format. -M, --msf Prints pairwise alignment for each HSP in MSF format. -N, --aln Prints pairwise alignment for each HSP in ALN format. -W, --show-coords Adds start/end positions to alignment output. GENERAL OPTIONS: -X, --expanded Expanded output (producing multiline output records). -c, --comments Include parameters from blast program as comments. -n, --no-comments Do not print "#" lines (raw output without comments). -v, --verbose Warnings sent to <STDERR>. --version Prints program version and exits. -h, --help Shows this help and exits. OUTPUT FORMATS
: "S_" stands for "Subject_Sequence" and "Q_" for "Query_Sequence". <Program> name is taken from input blast file. <Strands> are calculated from <start> and <end> positions on original blast file. <Frame> is obtained from the blast file if is present else is set to ".". <SCORE> is set to Alignment Score by default, you can change it with "-b" and "-i". If "-S" or "--subject" options are given, then QUERY fields are referred to SUBJECT and SUBJECT fields are relative to QUERY (this only available for GFF output records). Dots ("...") mean that record description continues in the following line, but such record is printed as a single line record by parse- blast. [HSP] <- (This is the DEFAULT OUTPUT FORMAT) <Program> <DataBase> : ... ... <IdentityMatches> <Min_Length> <IdentityScore> ... ... <AlignmentScore> <BitScore> <E_Value> <P_Sum> : ... ... <Q_Name> <Q_Start> <Q_End> <Q_Strand> <Q_Frame> : ... ... <S_Name> <S_Start> <S_End> <S_Strand> <S_Frame> : <S_FullDescription> [GFF] <Q_Name> <Program> hsp <Q_Start> <Q_End> <SCORE> <Q_Strand> <Q_Frame> <S_Name> [FULL GFF] <- (GFF showing alignment data) <Q_Name> <Program> hsp <Q_Start> <Q_End> <SCORE> <Q_Strand> <Q_Frame> ... ... Target "<S_Name>" <S_Start> <S_End> ... ... E_value <E_Value> Strand <S_Strand> Frame <S_Frame> [APLOT] <- (GFF format enhanced for APLOT program) <Q_Name>:<S_Name> <Program> hsp <Q_Start>:<S_Start> <Q_End>:<S_End> <SCORE> ... ... <Q_Strand>:<S_Strand> <Q_Frame>:<S_Frame> <BitScore>:<HSP_Number> ... ... # E_value <E_Value> [EXPANDED] MATCH(<HSP_Number>): <Q_Name> x <S_Name> SCORE(<HSP_Number>): <AlignmentScore> BITSC(<HSP_Number>): <BitScore> EXPEC(<HSP_Number>): <E_Value> Psum(<P_Sum>) IDENT(<HSP_Number>): <IdentityMatches>/<Min_Length> : <IdentityScore> % T_GAP(<HSP_Number>): <TotalGaps(BothSeqs)> FRAME(<HSP_Number>): <Q_Frame>/<S_Frame> STRND(<HSP_Number>): <Q_Strand>/<S_Strand> MXLEN(<HSP_Number>): <Max_Length> QUERY(<HSP_Number>): length <Q_Length> : gaps <Q_TotalGaps> : ... ... <Q_Start> <Q_End> : <Q_Strand> : <Q_Frame> : <Q_FullSequence> SBJCT(<HSP_Number>): length <S_Length> : gaps <S_TotalGaps> : ... ... <S_Start> <S_End> : <S_Strand> : <S_Frame> : <S_FullSequence> SEE ALSO
ali2gff(1), blat2gff(1), gff2aplot(1), sim2gff(1). AUTHOR
parseblast was written by Josep F. Abril <abril@imim.es>. This manual page was written by Nelson A. de Oliveira <naoliv@gmail.com>, for the Debian project (but may be used by others). Mon, 21 Mar 2005 21:44:15 -0300 PARSEBLAST(1)
All times are GMT -4. The time now is 01:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy