The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 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

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-15-2001
Registered User
 

Join Date: Aug 2001
Posts: 13
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
  #2 (permalink)  
Old 11-15-2001
Registered User
 

Join Date: Nov 2001
Posts: 1
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
  #3 (permalink)  
Old 11-15-2001
Registered User
 

Join Date: Aug 2001
Posts: 13
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
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0