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
CKEY(7) 						 Miscellaneous Information Manual						   CKEY(7)

NAME
ckey - The standard definition of each function key in cWnn system. DESCRIPTION
---------------------------------------------------------- | Function | Other | Description | Function | Function | | Keys | Keys | | In Input | In Input | | | | | State | State | | (a) | (b) | (c) | (d) | (e) | |----------+-------+---------------+------------+----------| | - | ^ |To toggle input| Similar to | Similar | | | | mode ON/OFF | (c) | to (c) | |----------+-------+---------------+------------+----------| | PF1 | - | To toggle | To Toggle | Similar | | | | phonetic input| among input| to (d) | | | | mode | methods | | |----------+-------+---------------+------------+----------| | PF2 | - | To toggle | To toggle | Similar | | | | encoded input | among input| to (d) | | | | mode | methods | | |----------+-------+---------------+------------+----------| | PF3 | - | To toggle | To toggle | Similar | | | | ASCII | among | to (d) | | | | character | different | | | | | input mode | ASCII | | | | | | character | | | | | | input | | | | | | methods | | |----------+-------+---------------+------------+----------| | PF4 | - | Toggle other | To toggle | Similar | | | | input mode | among | to (d) | | | |(only in Pinyin| different | | | | | centred input | input | | | | | environment) | methods | | | | | + | + | | | | | Toggle the | Similar to | | | | | environment | (c) | | | | | operation | | | | | | functions | | | | | |(same as PF6) | | | | | |(only in Zhuyin| | | | | | centred input | | | | | | environment & | | | | | |Combined Pinyin| | | | | | & Zhuyin input| | | | | | environment | | | |----------+-------+---------------+------------+----------| | PF5 | - | To select the | Similar to | Similar | | | | different | (c) | to (c) | | | | input keys | | | | | | allocations | | | |----------+-------+---------------+------------+----------| | PF6 | - | To toggle the | To select | Similar | | | | environment | among the | to (d) | | | | operations | different | | | | | | environment| | | | | | operation | | | | | | functions | | |----------+-------+---------------+------------+----------| | - | ^G | To quit the | Similar to | Similar | | | | environment | (c) | to (c) | | | | operation | | | | | | functions | | | |----------+-------+---------------+------------+----------| |Conversion| ^W | To perform | Similar to | Similar | | key | | Hanzi | (c) | to (d) | | | | conversion | + | | | | | | To list out| | | | | | possible | | | | | | candidates | | |----------+-------+---------------+------------+----------| |Conversion| - | To extract a | - | Similar | | key | | candidate from| | to (c) | | | | the candidate | | | | | | list | | | |----------+-------+---------------+------------+----------| | - | ^Z | To treat the | Similar to | Similar | | | | input string | (c) | to (d) | | | | as a phrase & | + | | | | | perform phrase| To list out| | | | | conversion | possible | | | | | | phrase | | | | | | candidates | | |----------+-------+---------------+------------+----------| | Confirm | ^L | To confirm the| Similar to | Similar | | key | | conversion | (c) | to (d) | | | | result | | | |----------+-------+---------------+------------+----------| | Confirm | - | To extract a | - | Similar | | key | | candidate | | to (c) | | | | from the | | | | | | candidate list| | | |----------+-------+---------------+------------+----------| | Right | ^F | To move cursor| To move the| Similar | | arrow | | one position | cursor one | to (d) | | key | | to the right | unit to the| + | | | | during input | right | To move | | | | state, edit | | to the | | | | state, & when | | next | | | | using PF6 | | candidate| | | | functions | | on the | | | | | | right | |----------+-------+---------------+------------+----------| | Left | ^B | To move cursor| To move the| Similar | | arrow | | one position | cursor one | to (d) | | key | | to the left | unit to the| + | | | | during input | left | To move | | | | state, edit | | to the | | | | state, & when | | next | | | | using PF6 | | candidate| | | | functions | | on the | | | | | | left | |----------+-------+---------------+------------+----------| | Up | ^P | To move to the| Similar to | Similar | | arrow | | previous menu | (c) | to (c) | | key | | or previous | + | + | | | | set of | To recall | To obtain| | | | candidates. | the | the | | | | Also apply | previous | previous | | | | when using | input | single | | | | functions in | | candidate| | | | PF6 | | | |----------+-------+---------------+------------+----------| | Down | ^N | To move to the| Similar to | Similar | | arrow | | next menu or | (c) | to (c) | | key | | the next set | + | + | | | | of candidates.| To recall | To obtain| | | | Also apply | the | the | | | | when using | next input | next | | | | functions in | | single | | | | PF6 | | candidate| |----------+-------+---------------+------------+----------| | - | ^D | To delete an | Similar to | Similar | | | | input unit | (c) | to (d) | | | | + | | | | | | Delete a word | | | | | | or character, | | | | | | or dictionary | | | | | | in the | | | | | | environment | | | | | | operations PF6| | | |----------+-------+---------------+------------+----------| | Backspace| - | To delete an | Similar to | Similar | | key | | input | (c) | to (c) | | | | character | | | |----------+-------+---------------+------------+----------| | - | ^E | Move cursor to| Move cursor| Move the | | | | the last input| to the last| cursor to| | | | unit (end) or | unit of the| the last | | | | to the last | user input | candidate| | | | candidate of | string | in the | | | | the list. | | current | | | | Also apply | | set of | | | | when using | | candidate| | | | functions in | | | | | | PF6 | | | |----------+-------+---------------+------------+----------| | - | ^A | Move cursor to| Move cursor| Move the | | | | the first | to the | cursor to| | | | unit | first unit | the last | | | | (beginning) or| of the user| candidate| | | | to the first | input | in the | | | | candidate of | string | current | | | | of the list | | set of | | | | Also apply | | candidate| | | | when using | | | | | | functions in | | | | | | PF6 | | | |----------+-------+---------------+------------+----------| | - | ^K | To undo a | To delete | Similar | | | | conversion | an input | to (d) | | | | from the | string from| + | | | | cursor | the cursor | Similar | | | | position to | position to| to (c) | | | | the end of the| the end of | If press | | | | input string | the input | twice, | | | |(if press once)| string | will | | | | |(press once)| cancel | | | | | | the whole| | | | | | converted| | | | | | Hanzi | | | | | | string | |----------+-------+---------------+------------+----------| | - | ^I | To shorten the| - | Separate | | | | length of a | | a word | | | | word phrase by| | into | | | | one character | |individual| | | | | |characters| |----------+-------+---------------+------------+----------| | - | ^O | To extend the | - | Join the | | | | length of a | |characters| | | | word phrase by| | into one | | | | one character | | word | |----------+-------+---------------+------------+----------| | - | ^G | To extract a | - | Similar | | | | candidate from| | to (c) | | | | the candidate | | | | | | list | | | |----------+-------+---------------+------------+----------| | - | ^C | To perform | - | Re-enter | | | | reverse | | into the | | | | conversion | | input or | | | | | | insert | | | | | | mode | | | | | | (if press| | | | | | once ) | | | | | | + | | | | | | Perform | | | | | | reverse | | | | | |conversion| | | | | | (if press| | | | | | twice ) | ---------------------------------------------------------- 13 May 1992 CKEY(7)