Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: search for chr() fails

by LanX (Saint)
on May 21, 2013 at 00:08 UTC ( [id://1034430]=note: print w/replies, xml ) Need Help??


in reply to search for chr() fails

you changed your code in the meantime from

perl -e 'print substr($_,index($_,chr(219)));'

to a while loop...

Try to use the options "-ne" to loop over the file

perl -ne 'print substr($_,index($_,chr(219)));'

see perlrun

IMHO it still doesn't do anything useful.

I doubt you will ever explain what it was supposed to do.

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^2: search for chr() fails
by tbone654 (Beadle) on May 21, 2013 at 01:30 UTC
    I just want to return the position where it finds the character, whatever it's called... then I can print the text between the two instances of the character...
      > then I can print the text between the two instances of the character...

      many of your example lines have only one instance of that character.

      Otherwise you could just use something like  print ((split /\xA0/,$_)[1])

      Cheers Rolf

      ( addicted to the Perl Programming Language)

      update

      corrected escape code

        yes... I'm familiar with and also comfortable with split...
        What I showed was an excerpt of the intersection of two files, one of which has 1 occurance, and one that has two. I will just do something to the data first, depending on which instance before I append them together...

        Thank you for your help...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-03-19 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found