delete to end of line with SED


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting delete to end of line with SED
# 8  
Old 07-01-2008
\1 is used when you have grouped parenthesis. In your code, you don't have them. so it will not work. use substitution instead. assuming always 8 digits
Code:
sed 's/NUMBER \[.\{8\}\].*//' file

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete lines that contain a pattern from specific line to the end.

Gents, I am trying to delete all lines which start with "H" character, but keeping the fist header. Example In the input file I will delete all lines starting from line 8 which contents character "H" to the end of the file. I try sed '8,10000{/^H/d;}' file But as don't know the end... (1 Reply)
Discussion started by: jiam912
1 Replies

2. UNIX for Dummies Questions & Answers

delete trailing whitespace from end of each line in column 1 only

Hi All. How can I convert this: ABC_1_1 ABC_1_2 ABC_1_3 into this: ABC_1 1 ABC_1 2 ABC_1 3 I tried this command but it is not working: awk '{sub(/+$/,"\t", $1)}{print}' Any suggestions on how to fix this? Thank you :wall: Please use code tags when posting data and... (3 Replies)
Discussion started by: danieladna
3 Replies

3. Shell Programming and Scripting

sed removing until end of line

All: Can somebody help me out with a sed command, which removes the the first occurance of ')' until the end of the line If I have the following input ... (5 Replies)
Discussion started by: BeefStu
5 Replies

4. UNIX for Dummies Questions & Answers

Removing end of line using SED

Hello Friends, How can I remove the last two values of this line using sed John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638:9/3/90:45900 The result should look like this: John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638 (3 Replies)
Discussion started by: humkhn
3 Replies

5. Shell Programming and Scripting

delete to end of formatted warnings using sed or cut...

hi, i've searched the forums' entries and have tried some of the examples -- to no avial -- this is my first post -- thanks in advance for your help... As part of an installation program -- i'm receiving two(2) extraneous "libcxb WARNING!" statements -- i want to use sed to eliminate the... (12 Replies)
Discussion started by: rickkar
12 Replies

6. UNIX for Advanced & Expert Users

Urgent Help required : awk/sed help to find pattern and delete till end of line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (1 Reply)
Discussion started by: rajan_san
1 Replies

7. Shell Programming and Scripting

Urgent! Sed/Awk Filter Find Pattern Delete Till End Of Line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (2 Replies)
Discussion started by: rajan_san
2 Replies

8. UNIX for Dummies Questions & Answers

SED: How to delete from expression to end of line

I have the following line(s) of text in a file: Card: H'00f2 Elapsed Time (day - h:m:s): 0 - 21:14:18.5 I basically want to search for "Elapsed Time", then delete this and everything else to the end of the line. I've tried a lot of different things, but cannot seem to get rid of... (1 Reply)
Discussion started by: rtstanley
1 Replies

9. Shell Programming and Scripting

awk : delete ^M at the end of the line

Hi all, I'm newbi in scripting. could someone tell how to delete the ^M at the end of the linie with an awk command. many thanks in advance. (2 Replies)
Discussion started by: liliput
2 Replies

10. UNIX for Dummies Questions & Answers

sed to end of line

I know this is going to be an easy anwer, but I haven't been able to figure this out - even with the help of the previous posts. I want to go from this PROD USER anon; to this TEST; I have coded a few sed commands, and none of them are getting the job done. anon will not always be the... (2 Replies)
Discussion started by: djschmitt
2 Replies
Login or Register to Ask a Question
XFM_MAILCAP(5)								XFM							    XFM_MAILCAP(5)

NAME
xfm_mailcap - mailcap information for usage within xfm or xfmmailcap DESCRIPTION
To determine what command to use to open a file with a specific mime type, xfm(1) uses files in a format similar to the mailcap format. The extensions are special actions to open directories or files to load into the application window and to include other mailcap files, so that the default mailcap databases in ~/.mailcap, /etc/mailcap, /usr/share/etc/mailcap and /usr/local/etc/mailcap can be included. This man page describes which fields are used and the extensions. For general information of the syntax of these files read the man pages mailcap(5) and update-mime(8). While this files are supposed to be read by xfm(1), there also is the program xfmmailcap(1) to ease debugging. GENERAL FORMAT
There is one entry per line. Empty lines and lines starting with a hash (#) are ignored. Each line consists of parts separated by semi- colons (;). The first part is the mime part or the token include. The second part is the view option. This is followed by an arbitrary number of option names, followed by a value after a equal sign, if they have a value. INCLUDES
Lines with a mime-type include or !include are not treated as mailcap specifiers, but cause the filename described by the second argument to be read at this place. I recommend placing the following line at the end of every $HOME/.xfm/xfm_mailcap file: include; /etc/X11/xfm/mailcap OPTIONS USED BY XFM
test The value of this option (after unescaping) is executed using system(3). If it fails, the content of the line is not used for any- thing but increasing the amount of output. Some tests weather a DISPLAY environment variable are set are omitted and considered always true. nametemplate If this option has a value, the filename has to match it when a action is executed. Otherwise it is replaced by a symlink matching it. It has to contain exactly one unescaped occurrence of %s, which is used as wild card for any positive number of characters. edit This is the preferred action to open a file. Unless it is one of the special actions explained below, it has to contain exactly one unescaped occurance of %s, which is replaced by the filename to open, or the filename of a symlink to the file to open in the case the filename might be dangerous or does not match the nametemplate of this line. needsterminal If this option, which normally has no value, is there, the actions specified in this line are executed in an X terminal emulator. SPECIAL ACTIONS
If the action with the highest priority is one the special strings OPEN or LOAD, no shell is spawned and no command executed. Instead the current file window is changed to the selected directory (OPEN) or the file is supposed to be in the xfm(5) format and loaded into the application window(LOAD). FILES
$HOME/.xfm/xfm_mailcap Unless xfm(1) is told to look at a different place via X resource Xfm.mailcapFile, this is the first place xfm looks for a file with the describes format. xfmmailcap(1) always looks here first. /etc/X11/xfm/xfm_mailcap If the first file does not exists, xfm(1) (unless it gets told a different place via the X resource Xfm.systemwideMailcapFile) and xfmmailcap(1) look for this file. It is recommended that the file in the home directory includes this file to get the system wide defaults. SEE ALSO
xfm(1), xfmmailcap(1), mailcap(5), update-mime(8). xfm 20 April, 2006 XFM_MAILCAP(5)