![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to print the word | ss_psm | UNIX for Dummies Questions & Answers | 0 | 03-17-2008 02:22 PM |
| Print the characters in a word | chella | Shell Programming and Scripting | 5 | 10-17-2007 10:06 AM |
| ls command to print fifo of contents (or perl) | jerardfjay | Shell Programming and Scripting | 1 | 04-06-2006 03:01 PM |
| Print out just a word from the file | Kinki | Shell Programming and Scripting | 8 | 02-20-2005 11:40 PM |
| How to print contents on the screen? | aadba | UNIX for Advanced & Expert Users | 1 | 03-22-2004 10:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Using first word and print their contents using awk
suppose u hava a file
G1354R tGGC-CGC D1361N cGAC-AAC I1424T ATC-ACC R768W gCGG-TGG Q1382R CAG-CGG Q178E gCAG-GAG Y181C TAC-TGC .........cont. So the question is By searching for first word i.e.character say R output shud be R768W gCGG-TGG R182P CGG-CCG R189W gCGG-TG if Q then Q1382R CAG-CGG Q178E gCAG-GAG So.... continue with all characters .i.e. first word .. Thanks |
|
||||
|
shell sed
Hi,
This one should be ok. Code:
a=1; while [ $a -le 1 ] do echo "please input the character you would like to search,XX for exit" read var if [ $var = "XX" ] then a=2 fi cat a | sed -n "/^$var/p" done |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|