Sponsored Content
Full Discussion: Deleting by ID
Top Forums Shell Programming and Scripting Deleting by ID Post 40820 by boyler on Tuesday 23rd of September 2003 10:14:22 PM
Old 09-23-2003
Deleting by ID

Need to delete records from a text file. Very new to this and am using pico. The only way i can think of doing this is to generate an ID for every record then tell it to delete that particular ID. First question is how if possible do i give each entry an ID number, the second is would this code work to delete an ID entry

sed '/.*ID.*/d' list.txt > list.txt

Any other suggestions on ways items can be deleted from a text file?

Thanks for your help
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

deleting all the sub directories

hello., i am creating a certain sub directories as apart of my requirement, and then later on i have to delete all those sub directories.. ____________________________________________________ DIR1="/home/pavi/cvs/20071426/TEMP" echo " DIR1 is : " $DESTDIR1 echo... (2 Replies)
Discussion started by: pavan_test
2 Replies

2. UNIX for Dummies Questions & Answers

df -k and deleting files

hi everybody, urgently need solutioin aftet i execute the command df -k, i get to see al the memory status blah blah if some file system has 95% full then what should i do and any help on how and what to do ? help really appriciated. cheers (4 Replies)
Discussion started by: ajayr111
4 Replies

3. UNIX for Dummies Questions & Answers

Deleting every other Line in VI

Hello, How would one delete every other two lines using VI? For example, I have the following 8 lines: Line1 Line2 Line3 Line4 Line5 Line6 Line7 Line8 And wish to only delete lines 3-4 and 7-8. Is there a certain pattern which would make this easier? Thank you, -Jahn (8 Replies)
Discussion started by: Jahn
8 Replies

4. Shell Programming and Scripting

deleting when nothing is there

Hey I know how to use grep to eliminate a row when nothing there is a character that I dont want. But I encountered a problem where there is nothing there. Heres my example: Nam1 Nam2 Year Nam3 Month So for Nam1 there is nothing in the second column so I want to delete it... so... (1 Reply)
Discussion started by: kylle345
1 Replies

5. Shell Programming and Scripting

Deleting the Last value from a file

How do i use SED command to replace the last existance of ',' with a blank value OR CUT can also do?? Eg --> aaa,aaad,fsdfde, I want to replace it with aaa,aaad,fsdfde Thanks in Advance (7 Replies)
Discussion started by: theeights
7 Replies

6. Solaris

Deleting printing everywhere

I am in a prison system with a standalone (no internet connection) Solaris 8 network using Sun-Rays for clients (so no software is on the client side). We are finding a problem where inmates are using the print-to-file function to be able to rename folders everywhere on the server, meaning they are... (1 Reply)
Discussion started by: ixeye
1 Replies

7. Shell Programming and Scripting

deleting lines in ex

Hello, im using ex to manipulate some text. Im trying to delete all the lines except those on which a certain regex can be found. the important part of the script: ex temp << 'HERE' g/regex/p HERE this command prints the lines I want to end up with, but it doesnt delete the others.... (2 Replies)
Discussion started by: drareeg
2 Replies

8. Shell Programming and Scripting

Deleting file name

I need a way to remove all the file names with they are extension from a line of a document. For example: I have doc named "gara" with the following content: /media/gogo/6651-FEAB/Desktop/Desktop.jpg /media/gogo/6651-FEAB/Desktop.pdf /media/gogo/6651-FEAB/linux/logo1.jpg... (4 Replies)
Discussion started by: gogok_bg
4 Replies

9. UNIX for Dummies Questions & Answers

Deleting a pattern in UNIX without deleting the entire line

Hi I have a file: r58778.3|SOURCES={KEY=f665931a...,fw,221-705}|ERRORS={16_1:T,30_1:T,56_1:C,57_1:T,59_1:A,101_1:A,115:-,158_1:C,186_1:A,204:-,271_1:T,305:-,350_1:C,368_1:G,442_1:C,472_1:G,477_1:A}|SOURCE_1="Contig_1092402550638"(f665931a359e36cea0976db191ff60ff09cc816e) I want to retain... (15 Replies)
Discussion started by: Alyaa
15 Replies
pico(1) 						      General Commands Manual							   pico(1)

Name
       pico - simple text editor in the style of the Pine Composer

Syntax
       pico [-f] [+n] [-nn] [-t] [-v] [-w] [-z] [file]

Description
       Pico is a simple, display-oriented text editor based on the Pine message system composer.  As with Pine, commands are displayed at the bot-
       tom of the screen, and context-sensitive help is provided.  As characters are typed they are immediately inserted into the  text.   Editing
       commands are entered using control-key combinations.  As a work-around for communications programs that swallow certain control characters,
       you can emulate a control key by pressing ESCAPE twice, followed by the desired control character, e.g. "ESC ESC c" would be equivalent	to
       entering a ctrl-c.  The editor has five basic features: paragraph justification, searching, block cut/paste, a spelling checker, and a file
       browser.

       Paragraph justification (or filling) takes place in the paragraph that contains the cursor, or, if the cursor  is  between  lines,  in  the
       paragraph  immediately  below.  Paragraphs are delimited by blank lines, or by lines beginning with a space or tab.  Unjustification can be
       done immediately after justification using the control-U key combination.

       String searches are not sensitive to case.  A search begins at the current cursor position and wraps around the end of the text.  The  most
       recent search string is offered as the default in subsequent searches.

       Blocks  of  text  can be moved, copied or deleted with creative use of the command for mark (ctrl-underscore), delete (ctrl-k) and undelete
       (ctrl-u).  The delete command will remove text between the "mark" and the current cursor position, and place it in the "cut"  buffer.   The
       undelete command effects a "paste" at the current cursor position.

       The  spell  checker  examines all words in the text.  It then offers, in turn, each misspelled word for correction while highlighting it in
       the text.  Spell checking can be cancelled at any time.	Alternatively, pico will substitute for the default spell checking routine a  rou-
       tine defined by the SPELL environment variable.	The replacement routine should read standard input and write standard output.

       The  file browser is offered as an option in the "Read File" and "Write Out" command prompts.  It is intended to help in searching for spe-
       cific files and navigating directory hierarchies.  Filenames with sizes and names of directories in the current working directory are  pre-
       sented for selection.  The current working directory is displayed on the top line of the display while the list of available commands takes
       up the bottom two.  Several basic file manipulation functions are supported:  file renaming, copying, and deletion.

       More specific help is available in pico's online help.

Options
       -f     Use function keys for commands.  This option supported only in conjunction with UW Enhanced NCSA telnet.

       +n     Causes pico to be started with the cursor located n lines into the file. (Note: no space between "+" sign and number)

       -nn    The -nn option enables new mail notification.  The n argument is optional, and specifies how often,  in  seconds,  your  mailbox	is
	      checked  for new mail.  For example, -n60 causes pico to check for new mail once every minute.  The default interval is 180 seconds,
	      while the minimum allowed is 30. (Note: no space between "n" and the number)

       -t     Enable "tool" mode.  Intended for when pico is used as the editor within other tools (e.g., Elm, Pnews).	Pico will not  prompt  for
	      save on exit, and will not rename the buffer during the "Write Out" command.

       -v     View the file only, disallowing any editing.

       -w     Disable word wrap (thus allow editing of long lines).

       -z     Enable ^Z suspension of pico.

       Lastly,	when  a running pico is disconnected (i.e., receives a SIGHUP), pico will save the current work if needed before exiting.  Work is
       saved under the current filename with ".save" appended.	If the current work is unnamed, it is saved under the filename "pico.save".

Bugs
       The manner in which lines longer than the display width are dealt is not immediately obvious.  Lines that continue beyond the edge  of  the
       display are indicated by a '$' character at the end of the line.  Long lines are scrolled horizontally as the cursor moves through them.

Files
       pico.save	Unnamed interrupted work saved here.
       *.save		Interrupted work on a named file is saved here.

Authors
       Michael Seibel, mikes@cac.washington.edu
       Laurence Lundblade, lgl@cac.washington.edu
       Pico was originally derived from MicroEmacs 3.6, by Dave G. Conroy.
       Pico is a trademark of the University of Washington.
       Copyright 1989-1994 by the University of Washington.

See Also
       pine(1)
       Source distribution (part of the Pine Message System):
	  ftp://ftp.cac.washington.edu/mail/pine.tar.Z

								    Version 2.4 							   pico(1)
All times are GMT -4. The time now is 10:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy