![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| find and replace command in one line using one command | vasikaran | UNIX for Dummies Questions & Answers | 10 | 08-20-2008 10:40 AM |
| FIND returns different results in script | blt123 | Shell Programming and Scripting | 6 | 04-25-2008 11:55 PM |
| Blank line ? | varungupta | UNIX for Advanced & Expert Users | 2 | 09-10-2007 12:52 PM |
| first value of array returns blank | Sudhakar333 | Shell Programming and Scripting | 1 | 08-06-2007 09:16 AM |
| Mac address - what is line command to find and active new card | wmetz | IP Networking | 1 | 03-19-2002 04:44 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
cant find command that returns blank line
This is my list of sed commands: can anyone tell me where im going wrong. The script works on a file called data which contains 6 student id's and there answers for 6 questions.
!/bin/sh sed -e 's/*//g' \ #replace * with nothing -e s/ /X/g' \ #replacing empty space with X -e 's/960...../& \ #student No. /g' \ -e 's/[0-9][0-9][TFX][TFX][TFX][TFX]/&\ /g \ e 's/[TFX]/ &/g' \ When it outputs the file there is an extra line with nothing on it. How do i get rid of the extra line?? e.g. 52000012 01 8 02 4 03 8 04 2 05 0 06 6 52000013 01 8 02 4 03 10 Any suggestions would be greatfully recieved. ![]() |
|
||||
|
Your error appears to be here my firend.
-e 's/[0-9][0-9][TFX][TFX][TFX][TFX]/&\ /g \ Simply swap it for this and I believe it will work... -e 's/[0-9][0-9][TFX][TFX][TFX][TFX]/\ &/g \ Pretty simple really... But in future I suggest you dont post your university assignments on notice boards. Their assigned to you and only you! Priar |
|
||||
|
Thankyou my good friend
I do generally want to learn unix. Ive spent hours on this. I find the manual pages very hard to understand and the book unix in a nut shell doesnt feature anything about the command
Thanks for your help anyway much appreciated ![]() |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| learn unix |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|