Sponsored Content
Top Forums Shell Programming and Scripting deleting a pattern from a file Post 302312241 by lassimanji on Thursday 30th of April 2009 05:46:19 PM
Old 04-30-2009
deleting a pattern from a file

say i have a file with the following contents

0x20
0x20
0xc23886
> 0xc12354
> 0xc567555555

i want to delete "> " pattern and keep the rest of the file
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

prom in deleting a pattern

hi guys, i have a directory.inside that so many directories and files are there.i want to search the complete directory for a pattern in all the .txt files.if i will find that pattern then i want to delete that pattern from that file. please help me out. i want it urgent (18 Replies)
Discussion started by: suvendu4urs
18 Replies

2. UNIX for Dummies Questions & Answers

Checking for a file in file pattern before deleting it

Hi, I need a script where I have delete all the files of type abc*.* from the directory /lmn/opq (passed as parameter to script) But I need to check if there is file of type abc*.* existing in the directory or not before I use the rm abc*.* command. Thanks (1 Reply)
Discussion started by: dsrookie
1 Replies

3. Shell Programming and Scripting

deleting lines after pattern using sed

I have seen there are many sed posts but still it is quite difficult to apply other post to my own problem How can I delete all lines in a file from 2 lines after this pattern *End_fine_coreg:_NORMAL to the end of file? Cheers (2 Replies)
Discussion started by: larne
2 Replies

4. Shell Programming and Scripting

deleting multiple accourances of a pattern from a file

I have a .sh file with the following contents: a b c a a b d c i want to delete the multiple occurances and keep one. say there are 3 a's in the file. I want to delete 2 of them and just keep 1 occurance. (11 Replies)
Discussion started by: lassimanji
11 Replies

5. Shell Programming and Scripting

Searching a pattern in file and deleting th ewhole line containing the pattern

Hi All, Please can someone assist in the script I have made that searches a pattern in a file and delete the whole line containing the pattern. #!bin/sh # The pattern that user want to add to the files echo "Enter the pattern of the redirect" read value # check if the user has... (1 Reply)
Discussion started by: Shazin
1 Replies

6. Shell Programming and Scripting

deleting lines in a file that match a pattern without opening it

In Unix, how do I delete lines in a file that match a particular pattern without opening it. File contents are foo line1 misc whatever foo line 2 i want to delete all lines that have the pattern "foo" without opening the file. File should eventually contain misc whatever (1 Reply)
Discussion started by: osbourneric
1 Replies

7. Shell Programming and Scripting

Deleting pattern without removing line

I am trying to delete a pattern without removing line. I searched a lot in this forum and using those I could come up with sed command but it seems that command does not work. Here's how my file looks like: 1 ./63990 7 1171 ./63990 2 2425 ./63990 9 2539 ./63990 1 3125 ./63990 1 10141... (7 Replies)
Discussion started by: shoaibjameel123
7 Replies

8. Shell Programming and Scripting

awk - writing matching pattern to a new file and deleting it from the current file

Hello , I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a new file and then delete the line from the current file. Can someone tell me how i could go... (2 Replies)
Discussion started by: goddevil
2 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

10. Shell Programming and Scripting

Help with a deleting lines based on a pattern

I have a header-detail file that goes like this: SHP00288820131021110921 ORDER0156605920131021110921INMMMMFN DETAIL0004 4C2Z 10769 AAFC 0000009600000094 4C2Z 10769 AAFC 0000672107 OIL DETAIL0002 ER3Z 14300 E 0000001300000012 ER3Z 14300 E 0000672107 OIL... (3 Replies)
Discussion started by: rbaggio666
3 Replies
CTYPE(2)							System Calls Manual							  CTYPE(2)

NAME
isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii, toascii, _toupper, _tolower, toupper, tolower - ASCII character classification SYNOPSIS
#include <u.h> #include <libc.h> #include <ctype.h> isalpha(c) isupper(c) islower(c) isdigit(c) isxdigit(c) isalnum(c) isspace(c) ispunct(c) isprint(c) isgraph(c) iscntrl(c) isascii(c) _toupper(c) _tolower(c) toupper(c) tolower(c) toascii(c) DESCRIPTION
These macros classify ASCII-coded integer values by table lookup. Each is a predicate returning nonzero for true, zero for false. Isascii is defined on all integer values; the rest are defined only where isascii is true and on the single non-ASCII value EOF; see fopen(2). isalpha c is a letter, a-z or A-Z isupper c is an upper case letter, A-Z islower c is a lower case letter, a-z isdigit c is a digit, 0-9 isxdigit c is a hexadecimal digit, 0-9 or a-f or A-F isalnum c is an alphanumeric character, a-z or A-Z or 0-9 isspace c is a space, horizontal tab, newline, vertical tab, formfeed, or carriage return (0x20, 0x9, 0xA, 0xB, 0xC, 0xD) ispunct c is a punctuation character (one of !"#$%&'()*+,-./:;<=>?@[]^_`{|}~) isprint c is a printing character, 0x20 (space) through 0x7E (tilde) isgraph c is a visible printing character, 0x21 (exclamation) through 0x7E (tilde) iscntrl c is a delete character, 0x7F, or ordinary control character, 0x0 through 0x1F isascii c is an ASCII character, 0x0 through 0x7F Toascii is not a classification macro; it converts its argument to ASCII range by anding with 0x7F. If c is an upper case letter, tolower returns the lower case version of the character; otherwise it returns the original character. Toup- per is similar, returning the upper case version of a character or the original character. Tolower and toupper are functions; _tolower and _toupper are corresponding macros which should only be used when it is known that the argument is upper case or lower case, respectively. Alef These routines are not provided in Alef. SOURCE
/sys/include/ctype.h for the macros. /sys/src/libc/port/ctype.c for the tables. BUGS
These macros are ASCII-centric. CTYPE(2)
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy