The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-15-2001
jeffersno1 jeffersno1 is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 16
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.
  #2 (permalink)  
Old 11-15-2001
priar priar is offline
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
jeffersno1 jeffersno1 is offline
Registered User
  
 

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

Bookmarks

Tags
learn unix

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0