Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How do I print only some letters of this string

by nuance (Hermit)
on Jun 21, 2000 at 16:38 UTC ( #19213=note: print w/replies, xml ) Need Help??


in reply to How do I print only some letters of this string

Apologies: I'm aware that these lines are much too long, unfortunately, you can't really see the structure of the data if I wrap them.

I've reformatted your question and it looks like what you're actually trying is to limit the string to 100 chatracters, like this :

2000/06/19 15:22:13 NIB1_BSX Communications Alarm + Critical OMC and equipment Connection broken 2000/06/19 15:22:15 NIB1_MSC Communications Alarm + Critical OMC and equipment Connection broken and up 2000/06/19 16:03:25 [1]NIB1_MSC.0.0.3.0 Communications Alarm + Minor E1 Port Receive Carrier Loss this output : (?) 2000/06/19 15:22:13 NIB1_BSX Communications Alarm + Critical OMC and equipment 2000/06/19 15:22:15 NIB1_MSC Communications Alarm + Critical OMC and equipment 2000/06/19 16:03:25 [1]NIB1_MSC.0.0.3.0 Communications Alarm + Minor E1 Port Receive C

you can use the substr function

substr($line, 99, 10000000,"");

should do what you want.

#!/usr/bin/perl -w use strict; foreach (<DATA>) { substr($_,99,10000000,""); print "$_\n"; } __DATA__ 2000/06/19 15:22:13 NIB1_BSX Communications Alarm + Critical OMC and equipment Connection broken 2000/06/19 15:22:15 NIB1_MSC Communications Alarm + Critical OMC and equipment Connection broken and up 2000/06/19 16:03:25 [1]NIB1_MSC.0.0.3.0 Communications Alarm + Minor E1 Port Receive Carrier Loss

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://19213]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2022-05-28 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?