Visit Our UNIX and Linux User Community


Line space problem facing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Line space problem facing
# 1  
Old 09-18-2009
Line space problem facing

Hi,

I got a list of file that all got the same standard format.
Can anyone teach me how to put the space in all of them?!

Input file:
>nucleotide1
AAAAAAAAACCCGGG
>nucleotide2
GGGGGGCCCCCTTTTA
>nucleotide3
GGTACACCACACTCAC
>nucleotide4
TTTGGAGAGAGACCCC

desired output:
>nucleotide1
AAAAAAAAACCCGGG

>nucleotide2
GGGGGGCCCCCTTTTA

>nucleotide3
GGTACACCACACTCAC

>nucleotide4
TTTGGAGAGAGACCCC



Thanks a lot for all of your guide and suggestion Smilie
# 2  
Old 09-18-2009
Code:
Input:
>nucleotide1
AAAAAAAAACCCGGG
>nucleotide2
GGGGGGCCCCCTTTTA
>nucleotide3
GGTACACCACACTCAC
>nucleotide4
TTTGGAGAGAGACCCC

Code:
$ sed 's/^>/\n>/g' filename

Code:
Output
>nucleotide1
AAAAAAAAACCCGGG

>nucleotide2
GGGGGGCCCCCTTTTA

>nucleotide3
GGTACACCACACTCAC

>nucleotide4
TTTGGAGAGAGACCCC

# 3  
Old 09-18-2009
Thanks a lot skmdu,
It is worked now d Smilie
I very appreciate for your help ^^

Quote:
Originally Posted by skmdu
Code:
Input:
>nucleotide1
AAAAAAAAACCCGGG
>nucleotide2
GGGGGGCCCCCTTTTA
>nucleotide3
GGTACACCACACTCAC
>nucleotide4
TTTGGAGAGAGACCCC

Code:
$ sed 's/^>/\n>/g' filename

Code:
Output
>nucleotide1
AAAAAAAAACCCGGG

>nucleotide2
GGGGGGCCCCCTTTTA

>nucleotide3
GGTACACCACACTCAC

>nucleotide4
TTTGGAGAGAGACCCC

# 4  
Old 09-18-2009
Code:
sed -n '/>/!{p;}
        />/{
        1{p;}
        1!{x;p;x;p;}
        }' a.txt

# 5  
Old 09-25-2009
can't work?!
Quote:
Originally Posted by summer_cherry
Code:
sed -n '/>/!{p;}
        />/{
        1{p;}
        1!{x;p;x;p;}
        }' a.txt


Previous Thread | Next Thread
Test Your Knowledge in Computers #796
Difficulty: Medium
Fractions in binary arithmetic terminate only if 2 is the only prime factor in the denominator.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with data re-arrangement problem facing

Input file: <symbol>Q9Y8G1</symbol> <name>Q9Y8G1_EMENI</name> <symbol>Q6V953</symbol> <symbol>Q5B8K1</symbol> <name>Q6V953_EMENI</name> <symbol>G1A416</symbol> <name>G1A416_9FUNG</name> <symbol>D4N894</symbol> <name>D4N894_PLEER</name> <symbol>B0FFU4</symbol>... (13 Replies)
Discussion started by: cpp_beginner
13 Replies

2. AIX

facing problem using su

Hi, I am able to login using su - or su directly , # prompt is coming, it doesnt ask for password. any normal user on aix system is login using su - or su . Please suggest where to change the configuration direct root login is disabled in /etc/ssh/sshd_config file. (0 Replies)
Discussion started by: manoj.solaris
0 Replies

3. Programming

can i have an optimal solution for this java code ? Facing Java heap space problem even at 3GB heaps

My desired output is run: for this 1 for this 2 for this 3 for this 4 for this 5 for this 1,2 1->2 for this 2,3 2->3 for this 3,4 3->4 for this 4,5 4->5 for this 1,2,3 1->2,3 (2 Replies)
Discussion started by: vaibhavkorde
2 Replies

4. Shell Programming and Scripting

problem facing in if -else condition

can u plz tell me where is the error echo enter the filename to be searched read fname if #-d $fname then echo file exists if then echo itsa directory elif then echo its readable cat $fname else echo its not readable fi else ... (1 Reply)
Discussion started by: gotam
1 Replies

5. Solaris

Facing problem with zone

i am using this way to create zone1 and zone2 bash-2.05b# zonecfg -z zone1 zone1: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:zone1> create zonecfg:zone1> set zonepath=/zone/1 zonecfg:zone1> set autoboot=true zonecfg:zone1> add net zonecfg:zone1:net>... (6 Replies)
Discussion started by: coxmanchester
6 Replies

6. Shell Programming and Scripting

facing problem in getting output on single line

i am using these two grep commands grep "^tipo" dump3_out.dat|awk -F"," '{for(i=1;i<=NF;i++){A=$i;B=substr($i, index($i, "=")+1);{print B }}}'|paste -s -d"||\n"|sed -e 's/^ //g' -e 's/| /|/g' >> result.dat grep -n "^ind" dump3_out.dat|cut -d "=" -f2|cut -d "," -f2|cut -d "n" -f1|tr -d '^ ' >>... (3 Replies)
Discussion started by: junaid.nehvi
3 Replies

7. Solaris

please help as i am facing problem with uptime

Hi I am getting the uptime output as follows 12:40am up 4 day(s), 18:29, 2 users, load average: 38.97, 36.54, 34.89 The load average is too high . I have checked the processes , but no process is taking too much cpu time Please help (3 Replies)
Discussion started by: guy009
3 Replies

8. UNIX for Dummies Questions & Answers

facing problem with cut command

hi , i used ls -ltr | cut -f 1 > \dev\tty but all teh coulmns r getting printed instead of only one........how can i resolve this? prob 2 : wud be able start cutting from last field......supposing in the case of dyanmic list.i dunno the field number of last column.......so is... (3 Replies)
Discussion started by: vivekshankar
3 Replies

9. UNIX for Dummies Questions & Answers

facing a problem in redirection

Hi, I am doing this perl script print (@line(1..15)); the lines 1 to 15 get printed... how can i redirect this to file? thanks and regards vivek.s (4 Replies)
Discussion started by: vivekshankar
4 Replies

Featured Tech Videos