Sponsored Content
Top Forums Shell Programming and Scripting Remove Multiple numbers from file. Post 302397608 by msalam65 on Monday 22nd of February 2010 05:05:33 PM
Old 02-22-2010
The issue with this solution is it is also removing 2 or more numbers which I not want it. I only want to remove numbers if it 7 or mor bytes.

Code:
 
 
sed 's/\([0-9]\{2,\}\)/ /g;s/   / /g' number.dat

Input : 
 
20M Corporation               
3M Inc. 888-356-8765          
3M Inc. 356-8765              
3M Inc. 3568765               
33M Inc.356-8765              
3M 8883568765 Inc.            
8883568765 3M Inc.            
WACHOVIA/WELLS FARGO E2677-010
620 WEST 152ND STREET ASSOC LLC
AETNA               NYC70  NY2

 
Output : 
 M Corporation
3M Inc.  - -
3M Inc.  -
3M Inc.
 M Inc. -
3M Inc.
  3M Inc.
WACHOVIA/WELLS FARGO E -
WEST  152ND  STREET  ASSOC  LLC
AETNA  NYC  NY

Please advise.

Thanks...

Last edited by msalam65; 02-22-2010 at 06:11 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to remove files with only numbers as file names?

Hi all, I have a bunch of files that are named like 12543, 467249877, etc all over some directories.These files are named only with numbers, they dont have any letters or special characters in their file names. Could you please help me out and give me some command/script to remove only those... (6 Replies)
Discussion started by: praveen_indramo
6 Replies

2. Shell Programming and Scripting

Command to remove numbers from beginning of txt file

Hello. I have the following issue: my txt file has the following format: train/dr4/fklc0/sx175.txt 0 80282 Severe myopia contributed to Ron's inferiority complex. train/dr4/fklc0/sx355.txt 0 42906 Dolphins are intelligent marine mammals. train/dr4/fklc0/sa2.txt With the... (1 Reply)
Discussion started by: li_bi
1 Replies

3. Shell Programming and Scripting

Remove multiple lines in the file

Hi, How to remove duplicate lines in the file. a ------ b c 24 23 a ---- c b (4 Replies)
Discussion started by: sandy1028
4 Replies

4. Shell Programming and Scripting

Remove Numbers from file

I have a file that has some text that looks like this Some Text 1. More text 2. Different text Final Text I would like the remove the lines of text that start with the numbers. Some Text Final Text I have tried to use cat file.txt | grep -Ev 1. >... (9 Replies)
Discussion started by: icculus99
9 Replies

5. Shell Programming and Scripting

Split a file into multiple files based on line numbers and first column value

Hi All I have one query,say i have a requirement like the below code should be move to diffent files whose maximum lines can be of 10 lines.Say in the below example,it consist of 14 lines. This should be moved logically using the data in the fisrt coloumn to file1 and file 2.The data of first... (2 Replies)
Discussion started by: sarav.shan
2 Replies

6. Shell Programming and Scripting

Renaming file that has multiple numbers as filename

Hi I have a file with filename as "partition-setup-and-ipl.vtcmd.76217657132.9721536798" Now i need to move this file as "partition-setup-and-ipl.vtcmd.76217657132.9721536798_org" i tried with # ls | grep -E "partition-setup-and-ipl.vtcmd.+"... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

7. Shell Programming and Scripting

How to remove the numbers in a file in perl script?

Thanks (1 Reply)
Discussion started by: Raysf
1 Replies

8. Shell Programming and Scripting

Remove multiple lines from a text file

Hi I have a text file named main.txt with 10,000 lines. I have another file with a list of line numbers (around 1000) of the lines to be deleted from main.txt file. I tried with sed but it removes only a range of line numbers. Thanks for any help!! (1 Reply)
Discussion started by: prvnrk
1 Replies

9. Shell Programming and Scripting

Remove '.' from file for numbers ending in '.'

Hi, I have numerous files which have data in the following format A|B|123.|Mr.|45.66|33|zz L|16.|33.45|AC.|45. I want to remove decimal point only if it is last character in a number. O/p should be A|B|123|Mr.|45.66|33|zz L|16|33.45|AC.|45 I tried this sed -e 's/.|/|/g' Problem... (6 Replies)
Discussion started by: wahi80
6 Replies

10. Shell Programming and Scripting

Remove space before numbers in delimited file

Hi, I have a file which looks like this FORD|1333-1| 10000100010203| 100040507697|0002|356.45|5555| SSSSY|KKKKM|1000005|10| N096|10043| C987 I need the output to look like this FORD|1333-1|10000100010203|100040507697|0002|356.45|5555| SSSSY|KKKKM|1000005|10| N096|10043| C987 The leading... (8 Replies)
Discussion started by: wahi80
8 Replies
NG_ATMLLC(4)						   BSD Kernel Interfaces Manual 					      NG_ATMLLC(4)

NAME
ng_atmllc -- ATM LLC netgraph node type SYNOPSIS
#include <netgraph/ng_atmllc.h> DESCRIPTION
The atmllc node type translates frames in to and out of ATM LLC encapsulation, as specified by RFC 1483. In LLC encapsulation the protocol of a given protocol data unit (PDU) is specified by an IEEE 802.2 LLC header, possibly followed by an IEEE 802.1a SubNetwork Attachment Point (SNAP) header. This node currently handles the Ethernet and FDDI protocols. The node transmits and receives ATM PDUs on the atm hook. Received PDUs are decoded and forwarded to the ether or fddi hooks as appropriate. Data received on the ether or fddi hooks are assumed to be full Ethernet or FDDI packets as appropriate and are encapsulated into a PDU and transmitted via the atm hook. HOOKS
This node type supports the following hooks: atm ATM connection. Typically, this hook would be connected to a ng_atm(4) node, which handles transmission of ATM PDUs over an ATM device. ether Ethernet connection. This hook sends and receives Ethernet frames. This would normally be connected to an ng_eiface(4) node if in use. fddi FDDI connection. This hook sends and receives FDDI frames. CONTROL MESSAGES
This node type supports the generic control messages. SHUTDOWN
This node shuts down upon receipt of a NGM_SHUTDOWN control message, or when all hooks have been disconnected. SEE ALSO
netgraph(4), ng_atm(4), ng_eiface(4), ngctl(8) J. Heinanen, Multiprotocol Encapsulation over ATM Adaptation Layer 5, RFC 1483. AUTHORS
Benno Rice <benno@FreeBSD.org> BSD
March 8, 2004 BSD
All times are GMT -4. The time now is 08:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy