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
Vi editor jazz High Level Programming 2 05-08-2009 08:46 AM
set EDITOR=vi -> default editor not setting for cron tab aarora_98 Shell Programming and Scripting 6 09-13-2008 02:01 AM
Which editor to use? Nafanja UNIX for Dummies Questions & Answers 5 11-29-2007 12:58 PM
vi editor eloquent99 UNIX for Dummies Questions & Answers 1 01-14-2003 05:49 AM
Using the vi editor pbsys UNIX for Dummies Questions & Answers 2 11-05-2001 03:27 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 10-18-2006
MaxK MaxK is offline
Registered User
  
 

Join Date: Oct 2006
Location: Toronto, Canada
Posts: 2
vi editor

Hello!
Can anybody give me a hint. Here is a task. T
Tere is a text file. It contains names. Some names have second and third names.
EX: Gordon Freeman
Contains second name
EX2: William Gilbert Ross
Contains second and third names
How can I delete lines that contain second and third names using one command?
Thank you in advance!!!!
  #2 (permalink)  
Old 10-18-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Looks like homework. Is it?
Do you want to just print only the first name on the screen, or do you want the file to be saved without the second/third names?

For the first, look up the man page of cut or awk. For the second, you'll have to use the vi editor. Check any of the myriad tutorials available online.
  #3 (permalink)  
Old 10-18-2006
MaxK MaxK is offline
Registered User
  
 

Join Date: Oct 2006
Location: Toronto, Canada
Posts: 2
Well, the thing is, those lines with second and third names have to be deleted from the file at all. The problem here is that the task is to delete all such lines using just one command. If it were not this strict I could use dd command in vi editor to do it.
By the way, the file must be edited in vi editor. So, apparently, there should some command to perform this task. That's why I asked.
Thank you, blowtorch, for the message.
Sponsored Links
Closed Thread

Bookmarks

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 10:18 PM.


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