Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

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

Q&A > input and output > How do I print only some letters of this string - Answer contributed by nuance

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
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2016-12-08 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (146 votes). Check out past polls.