![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| 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 07:40 AM |
| FIND returns different results in script | blt123 | Shell Programming and Scripting | 6 | 04-25-2008 08:55 PM |
| Blank line ? | varungupta | UNIX for Advanced & Expert Users | 2 | 09-10-2007 09:52 AM |
| first value of array returns blank | Sudhakar333 | Shell Programming and Scripting | 1 | 08-06-2007 06:16 AM |
| Mac address - what is line command to find and active new card | wmetz | IP Networking | 1 | 03-19-2002 12:44 PM |
|
|
Submit Tools | LinkBack | Thread Tools | 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.
__________________
Jeffers |
| Forum Sponsor | ||
|
|
|
|||
|
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
__________________
Jeffers |
|||
| Google The UNIX and Linux Forums |