Sponsored Content
Top Forums Shell Programming and Scripting Regular expression matching a new line Post 92549 by drheams on Monday 12th of December 2005 01:53:54 PM
Old 12-12-2005
Regular expression matching a new line

I have written a script to test some isdn links in my network and I am trying to format the output to be more readable. Each line of the output has a different number of digits as follows...

Sitename , spid1 12345678901234 1234567890 1234567 , spid2 1234567890 1234567890 1234567
Sitename , spid1 12345678901234 1234567890 , spid2 12345678901234 1234567890

I would like to drop any string of either 7 or 10 digits and keep ony the 14 digit strings. I have attemted the following command but it gives me an error "Invalid preceding regular expression"

sed 's/\<[0-9]\>\{7,10\}//g' oldfile > newfile

Can anyone point me in the right direction to format this file? Thank you for the assistance.
 

10 More Discussions You Might Find Interesting

1. Programming

Regular Expression matching in PERL

I am trying to read a file and capture particular lines into different strings: LENGTH: Some Content here TEXT: Some Content Here COMMENT: Some Content Here I want to be able to get (LENGTH: .... ) into one array and so on... I'm trying to use PERL in slurp mode but for some reason... (8 Replies)
Discussion started by: Legend986
8 Replies

2. Shell Programming and Scripting

Help: Regular Expression for Negate Matching String

Hi guys, as per subject I am having problem with regular expressions. Example, if i got a string "javax.servlet.http.HttpServlet.service" that may occurred anywhere within a text file. How can I used the negate pattern matching of regular expression? I tried the below pattern but it... (4 Replies)
Discussion started by: DrivesMeCrazy
4 Replies

3. Shell Programming and Scripting

Regular expression matching in BASH (equivalent of =~ in Perl)

In Perl I can write a condition that evaluates a match expression like this: if ($foo =~ /^bar/) { do blah blah blah } How do I write this in shell? What I need to know is what operator do I use? The '=~' doesn't seem to fit. I've tried different operators, I browsed the man page for... (3 Replies)
Discussion started by: indiana_tas
3 Replies

4. Shell Programming and Scripting

Regular expression matching

Hi, I have a variable in my script that gets its value from a procstack output. It could be a number of any length, or it could just be a '1' with 0 or more white spaces around it. I would like to detect when this variable is just a 1 and not a 1234, for example. This is as far as I got: ... (3 Replies)
Discussion started by: tmf33uk
3 Replies

5. Shell Programming and Scripting

Matching single quote in a regular expression

I trying to match the begining of the following line in a perl script with a regular expression. $ENV{'ORACLE_HOME'} I tried this regluar expession: /\$ENV\{\'ORACLE_HOME\'\}/ Instead of match, I got a blank prompt > It seems to be a problem with the single quote. If I take it... (11 Replies)
Discussion started by: JC9672
11 Replies

6. Shell Programming and Scripting

Regular Expression for line

Hi, I'm trying to extract if the (offset>0 || flags ) from the following line: 90.30.180.90.80 > 90.121.333.308.45133: Flags , seq 14480:15928, ack 1, win 8088, options > 15:59:11.156664 IP (tos 0x0, ttl 20, id 44442, offset 0, flags , proto TCP (6), length 1500) try: offset.(+) ||... (7 Replies)
Discussion started by: ENG_MOHD
7 Replies

7. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

8. UNIX for Dummies Questions & Answers

delete lines matching a regular expression

I have a very large file (over 700 million lines) that has some lines that I need to delete. An example of 5 lines of the file: HS4_80:8:2303:19153:193032 153 k80:138891 HS4_80:8:2105:5544:43174 89 k88:81949 165 k88:81949 323 0 * = 323 0 ... (6 Replies)
Discussion started by: pathunkathunk
6 Replies

9. Shell Programming and Scripting

regular expression matching whole words

Hi Consider the file this is a good line when running grep '\b(good|great|excellent)\b' file5 I expect it to match the line but it doesn't... what am i doing wrong?? (ultimately this regex will be in a awk script- just using grep to test it) Thanks, Storms (5 Replies)
Discussion started by: Storms
5 Replies

10. Shell Programming and Scripting

Extract regular expression and line below

Hi all, I have a large fasta (dna sequence) file. I would like to extract a portion of the header as well as the sequence (line below the header). Input: Output: All accession values (the term I want to preserve, which is the string including and directly following "GL") are different, but I... (8 Replies)
Discussion started by: pathunkathunk
8 Replies
AVMCAPICTRL(8)						    Linux System Administration 					    AVMCAPICTRL(8)

NAME
avmcapictrl - Add, reset or remove active AVM cards and load firmware SYNOPSIS
avmcapictrl add <portbase> <irq> <type> avmcapictrl load <bootcode> [<contrnr> [<protocol> [P2P | <dn1>:<spid1> [<dn2>:<spid2>]]]] avmcapictrl reset [contrnr] avmcapictrl remove [contrnr] avmcapictrl trace [contrnr] [off|short|on|full|shortnodata|nodata] avmcapictrl addcard <driver> <portbase> <irq> [ <membase> [ <cardnr> ] ] DESCRIPTION
avmcapictrl is used to register active AVM ISA cards kernelcapi system and therewith to the isdn system. You need it also to upload the firmware to any active AVM card. If an error occurred please also check the kernel error messages by using the command dmesg(8). COMMANDS
add <portbase> <irq> <type> is used to add a ISA card to the kernel-capi2.0 system. The portbase can have the values 0x150, 0x250, 0x300 and 0x340 for the B1 ISA cards, look at the jumper on the card. For a T1-ISA (HEMA) card you can select an wide range of ports. irq can be selected from the following values: 3, 4, 5, 6, 7, 9, 10, 11, 12 and 15. type can be B1 or T1. load <bootcode> [<contrnr> [<protocol> [P2P | <dn1>:<spid1> [<dn2>:<spid2>]]]] is used to load the firmware to a card bootcode is a t4-file. The actual versions of the t4-files for the different d-channel protocols can be found at ftp://ftp.avm.de/cardware/b1/linux/firmware. You need different t4-files for different d channel protocols: b1-1tr6.t4 for 1TR6, b1.t4 for DSS1 and b1-usa.t4 for 5ESS and NI1 (DSS1 is also supported). For M1/M2 PCMCIA cards you need m1-s10.t4 or m1-s4.t4 depending on the handy type used. contrnr is the number of the controller (card) starting from 1. protocol can be DSS1, CT1, VN3, AUSTEL, 5ESS or NI1. P2P point to point DN1:SPID1 DN2:SPID2 is for the North American 5ESS and NI1 protocols. reset [contrnr] is used to reset a card if loading has failed. This function only make sense if card is not successfully loaded. contrnr is the number of the controller (card) starting from 1. remove [contrnr] is used to remove a card previous added. You can also remove automatic added cards (for example a B1-PCI card). contrnr is the number of the controller (card) starting from 1. trace [contrnr] [off|short|on|full|shortnodata|nodata] is used to trace CAPI2.0 messages. The trace will be done as kernel messages, see dmesg(8). contrnr is the number of the controller (card) starting from 1. off switch tracing off short switch one line per CAPI2.0 message tracing on on | full switch on full decode tracing shortnodata switch on line per CAPI2.0 message tracing on, but exclude DATA_B3_IND and DATA_B3_REQ messages. on | full switch on full decode tracing, but exclude DATA_B3_IND and DATA_B3_REQ messages. addcard <driver> <portbase> <irq> [ <membase> [ <cardnr> ] ] is used to add a card, this is more generic than add. driver currently b1isa or t1isa portbase can have the values 0x150, 0x250, 0x300 and 0x340 for the b1isa driver, look at the jumper on the card. For t1isa driver you can select an wide range of ports. irq can be selected from the following values: 3, 4, 5, 6, 7, 9, 10, 11, 12 and 15. membase memory address if needed by driver cardnr only useful with driver t1isa AUTHOR
Carsten Paeth <calle@calle.in-berlin.de> SEE ALSO
ttyI(4), isdnctrl(8), isdninfo(4). dmesg(8). syslogd(8). 4th Berkeley Distribution 2000/01/28 AVMCAPICTRL(8)
All times are GMT -4. The time now is 07:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy