Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Delete specific strings in a file Post 302931137 by Scrutinizer on Sunday 11th of January 2015 01:13:49 AM
Old 01-11-2015
@sa@@: your sample contains a multiline sequence

Shouldn't the input file be:
Code:
>C4603985
ATGFFGTGFAGGHTGHTAHGHATAGGTHTTHAHAGHGCHATCACCTGCGATATGGGGGCCACCATAGATAGTAAAGATGGTTCTTACCFAGATGFFGTGFAGGHTGHTAHGHATAGGTFAGATGFFGTGFAGGHTGHTAHGHATAGGTFAGATGFFGTGFAGGHTGH
>C3914137
CATCTTGFFGTGFAGGHTGHTAHGHATAGGTHTTHAHAGHGCHTTATTAGGGAAGAAACCTTCATTCTCTTTTTAATTTTCTTTTTCAAGATGCAATTGFFGTGFAGGHTGHTAHGHATAGGTHTTHAHAGHGCHCTGTATCACCAGTTATATATAGATTGCATCTTGATATAGATATAGTG
>stt4468869
SQAERTYUVSAASSFFAGATGFFGTGFAGGHTGHTAHGHATAGGTHTTHAHAGHGCHAHAHGHACTHTGHTGGHCAHAANGGGATATAACCAGGTGGAAGGTAGACTACTTTGATAGTTTTTCTCCAGTNGNGCANAAGTTAGTAACAGTGAGAATTTTCTTAGCAATCGCAG
>C4913369
GTERTYUVSAASSFFAGATGFFGTGFAGGHTGHTAHGHATAGGTTGCVTCABGCGBATBAAGATBTBTHYHBHHTAGCGCCCTACGTACGATGCAGTAAATTCCGTAACGTAGTGGTTGAGATATCTCAGTAAGCTTCACGTTGACGTTAGTTBTBTAATCGCCCGTGATGDDDGTGTTAGAATGTTTAAAGGATATACAT
>stt4688097
GCDDDDCJJJJAWDDDDFFFFFCTCATATCGCAGGTGATTCCAACAGATCGCATGAGAGGTATGTCCGAGAGGCAAATCATTCTTTTCGGCTCTATGGATCCGAAGGACCTGCGAAAAGGGCAAAACCGACCTCGGACGAGATTGTGTTTACGGACGAGCATGAGAGGTATGTCCGAGAGGCAAATCATTCTTTTCGGCTCTATGGATCCGAAG

--
@Ravinder. That works if there are no multiline sequences.

Last edited by Scrutinizer; 01-11-2015 at 02:35 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete strings in a file

Hi, I have a file named status.txt that looks like the file below. What I want to do is to delete the part <status> and </status> and just leave the number and print each number per line. How can I do it? If I will use sed or awk how can I do it? I tried with sed but it didn't work. Maybe I... (8 Replies)
Discussion started by: ayhanne
8 Replies

2. Shell Programming and Scripting

delete strings till specific string

Hello i want to know a way so i can delete all the strings in file from the begning till a specific string (1 Reply)
Discussion started by: modcan
1 Replies

3. Shell Programming and Scripting

recursively delete the text between 2 strings from a file

i have 200000bytes size of a unix file i need to delete some text between two strings recursively using a loop with sed or awk . these two strings are : 1st string getting from a file :::2 nd string is fi...its constant . can anyone help me sed -n'/<1 st string >/,/fi/' <input_filename> is the... (2 Replies)
Discussion started by: santosh1234
2 Replies

4. Shell Programming and Scripting

Delete Strings that are present in another file

HI, if a String is present in file1.txt, i want to delete that String from file2.txt. How can i do this?? I am sure that the file1.txt is a subset of file2.txt. (2 Replies)
Discussion started by: jathin12
2 Replies

5. UNIX for Dummies Questions & Answers

Delete strings in file1 based on the list of strings in file2

Hello guys, should be a very easy questn for you: I need to delete strings in file1 based on the list of strings in file2. like file2: word1_word2_ word3_word5_ word3_word4_ word6_word7_ file1: word1_word2_otherwords..,word3_word5_others... (7 Replies)
Discussion started by: roussine
7 Replies

6. Shell Programming and Scripting

output strings to specific positions in a file

Been searching for about 3 hours for similar functionality that I can get examples of how to output text from variables into certain locations in a file. I would like to incorporate this into a script. I have not been able to find a command example that does it all in one method. I find part of... (1 Reply)
Discussion started by: bennu_500
1 Replies

7. Shell Programming and Scripting

Delete lines in file containing duplicate strings, keeping longer strings

The question is not as simple as the title... I have a file, it looks like this <string name="string1">RZ-LED</string> <string name="string2">2.0</string> <string name="string2">Version 2.0</string> <string name="string3">BP</string> I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies

8. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies

9. Shell Programming and Scripting

How to delete strings in a file?

hi, i have a big file like this: >s31 length=12 numreads=6 gene=isotig454 status=igo ldfddfdfdfdkkkkkkfdfdkkkksdfdkkkkkkkkkksdfd dfdfdfldfdkdffdlfddflfdjkkkkkkfdgkkgfhghfgkkk ldfddfdfdfdkkkkkkfdfdkkkksdfdkkkkkkkkkksdfd dfdfdfldfdkdffdlfddflfdjkkkkkkfdgkkgfhghfgkkk >c2 length =344... (4 Replies)
Discussion started by: the_simpsons
4 Replies

10. Shell Programming and Scripting

Count specific character of a file in each line and delete this character in a specific position

I will appreciate if you help me here in this script in Solaris Enviroment. Scenario: i have 2 files : 1) /tmp/TRANSACTIONS_DAILY_20180730.txt: 201807300000000004 201807300000000005 201807300000000006 201807300000000007 201807300000000008 2)... (10 Replies)
Discussion started by: teokon90
10 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 01:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy