Sponsored Content
Full Discussion: Saving file edited whith sed
Top Forums UNIX for Dummies Questions & Answers Saving file edited whith sed Post 302432766 by vanesa1230 on Saturday 26th of June 2010 07:33:50 PM
Old 06-26-2010
Data Saving file edited whith sed

HI!
I have a file that looks like this:

Code:
>ANKRD30_2kb
AAGTAACCAATGCAGGAAACCGAGAGGAGAGGTTTGGAAGGTGGTTTAGTGAGGTAATCCATCTTTTCT
AGTGATAAACTGGCACCCAGTCAATTTATTCATCAGAAGGGAATACATCAGCCTGGCGTGGTGGCTCGC
CCCCGACCCTGTCAGCGTCACCAGCAGCGCGGATCCATGGGCCAGAAGCCTCTAGGGCGCCTAAGTCAG
Number of residues in the repeat = 3
AAG
[ 1 to 3 ]
[ 38 to 40 ]
[ 106 to 108 ]
----------------------------------------------------------------------
Number of residues in the repeat = 3
AGA
[ 23 to 25 ]
----------------------------------------------------------------------
Number of residues in the repeat = 3
AGC
[ 119 to 121 ]
[ 152 to 154 ]
[ 161 to 163 ]
----------------------------------------------------------------------
Number of residues in the repeat = 3
>C3orf24_2kb
TTGTGGTGTGTGTTCTATAGTTTGTAAAATGCAAGGGCAATTCTGGGTGTACAAGGGAAGGCCAAGTAG
GCCATTAGTTACTTCCTCCCACAAATACTGCACACTGCCAGACATGGCAATAGCCAGGTACTGGGAATA
CAGACATCAGCTGGGTAGACTCCTCCCTTCCCTCAGCCATCCAGGGTCATTATTTTAAGTGATGATTAC
Number of residues in the repeat = 3
AAA
[ 26 to 28 ]
[ 27 to 29 ]
[ 92 to 94 ]
----------------------------------------------------------------------
Number of residues in the repeat = 3
AAG
[ 33 to 35 ]
[ 53 to 55 ]
----------------------------------------------------------------------
Number of residues in the repeat = 3

All I want to get from this file is:

Code:
>ANKRD30_2kb
AAG
AGA
AGC
>C3orf24_2kb
AAA
AAG

I've tried to use this command:
Code:
sed '/\[/,/^N/d' file|grep -v "^N"|sed '/^.\{50\}/d'

If I look with it using the head command it seems to work, but when I try to save it into a new file (>newfile) all I get is an empty file!!!. What am I doing wrong???Smilie
Thanks

Last edited by Scott; 06-27-2010 at 06:22 AM.. Reason: Code tags, please...
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Edited Path in Profile File

Definitely a unix dummy. I edited the paths in the /etc/profile file - following the instructions on an install package. Now can't use vi, cat pg ls or any other unix commands. Guess I'm in big trouble. Path reads MANPATH=/opt/hpnp/man PATH=/opt/hpnpl/bin LD_LIBRARY_PATH=/opt/hpnp/lib ... (4 Replies)
Discussion started by: thewetch
4 Replies

2. UNIX for Dummies Questions & Answers

Saving changes when using the sed command

Hi Guys, Working on a script in the Vi editor that requires the fifth column of a particular line changed. e.g. Name:Address:email:A where "A" needs to be changed to what the variable $access holds ($access currently has the words admin access in it) when I use this command : `sed... (3 Replies)
Discussion started by: rc1138
3 Replies

3. Solaris

/etc/profile file edited. No command working

I have X4500 and I created a user. I wanted to give him root privileges and for editing the sudoers files I typed visudo sudoers. But it said visudo command not found. After googling I found that we need to set path in etc/profile. I edited that and put the following command ... (3 Replies)
Discussion started by: bharu_sri
3 Replies

4. UNIX for Advanced & Expert Users

Who edited my text file?

I was editing my text file in gvim & I was getting message that its changed & to load again. I work in a workplace environment with everyone having there username.. How can I know that who edited my file? (4 Replies)
Discussion started by: krishanu
4 Replies

5. Shell Programming and Scripting

How to read a file name that was recently edited when listed using ls command?

I was trying to write a script that will process recently creatd file. From below, the script should process input_20111230.dat file. sam:/top/work/data/input: ls -ltr input_*.dat -rw-rw-rw- 1 work edprod 455668 Dec 24 09:16 input_20111224.dat -rw-r--r-- 1 work edprod ... (7 Replies)
Discussion started by: siteregsam
7 Replies

6. Shell Programming and Scripting

issue while copying file dynamically whith in loop?

I need to copy the log file dynamically and that should run in loop , which means it should pick what ever the latest file is updated in that directory. I am able to display the list and copy to directly but i have no idea on how to pick the dynamically updated files. when i use this code, i... (1 Reply)
Discussion started by: johninweb
1 Replies

7. UNIX and Linux Applications

Notepad++ hang when open file edited in other text editor

Hi, I would like to ask about the notepad++ text editor application, Although there are alternative and more great text editor in linux (gedit, geany, jedit) im still using the notepad++ sometimes cause for some of my own reason one of those is the minimalist text(what i mean is notepad++ has a... (2 Replies)
Discussion started by: jao_madn
2 Replies

8. Shell Programming and Scripting

sed - Print Edited Line Along With Original Line

Hi, I have an input file like this line1 line2 line3 hello unix how are you This is what I am expecting my output to be line1 line2 #line3 hello unix how are you line3 hello (3 Replies)
Discussion started by: jacobs.smith
3 Replies

9. Shell Programming and Scripting

sed command is saving output as blank file

Hi, I am working on a script where I am adding adding colors to few of the info in the output. Now , after that is done , I see colour codes in log files which I don't want to see.:mad::mad::mad::mad: So , I tried using sed command in script as below which gives me o/p (new.log) as blank file... (7 Replies)
Discussion started by: Dream4649
7 Replies
KBDRATE(8)						     Linux Programmer's Manual							KBDRATE(8)

NAME
kbdrate - reset the keyboard repeat rate and delay time SYNOPSIS
kbdrate [ -s ] [ -r rate ] [ -d delay ] DESCRIPTION
kbdrate is used to change the keyboard repeat rate and delay time. The delay is the amount of time that a key must be depressed before it will start to repeat. Using kbdrate without any options will reset the repeat rate to 10.9 characters per second (cps) and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems. These are the IBM defaults. On SPARC-based systems it will reset the repeat rate to 5 cps and the delay to 200 ms. OPTIONS
-s Silent. No messages are printed. -r rate Change the keyboard repeat rate to rate cps. For Intel-based systems, the allowable range is from 2.0 to 30.0 cps. Only certain, specific values are possible, and the program will select the nearest possible value to the one specified. The possible values are given, in characters per second, as follows: 2.0, 2.1, 2.3, 2.5, 2.7, 3.0, 3.3, 3.7, 4.0, 4.3, 4.6, 5.0, 5.5, 6.0, 6.7, 7.5, 8.0, 8.6, 9.2, 10.0, 10.9, 12.0, 13.3, 15.0, 16.0, 17.1, 18.5, 20.0, 21.8, 24.0, 26.7, 30.0. For SPARC-based systems, the allowable range is from 0 (no repeat) to 50 cps. -d delay Change the delay to delay milliseconds. For Intel-based systems, the allowable range is from 250 to 1000 ms, in 250 ms steps. For SPARC systems, possible values are between 10 ms and 1440 ms, in 10 ms steps. -V Display a version number and exit. BUGS
Not all keyboards support all rates. Not all keyboards have the rates mapped in the same way. Setting the repeat rate on the Gateway AnyKey keyboard does not work. If someone with a Gateway figures out how to program the keyboard, please send mail to util-linux@math.uio.no. All this is very architecture dependent. Nowadays kbdrate first tries the KDKBDREP and KIOCSRATE ioctls. (The former usually works on an m68k machine, the latter for SPARC.) When these ioctls fail an ioport interface as on i386 is assumed. FILES
/etc/rc.local /dev/port Linux 1.1.19 22 June 1994 KBDRATE(8)
All times are GMT -4. The time now is 12:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy