Find the answer to your Linux question:
Results 1 to 2 of 2
Assume I have a file with a lot of data sets like Code: <a/> My name is <b1> Bill </b1> <a/> My name is <b2> John Smith</b2> and I only ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    58

    Find the position of tags in a sentence


    Assume I have a file with a lot of data sets like

    Code:
    <a/> My name is <b1> Bill </b1>
    <a/> My name is <b2> John Smith</b2>
    and I only want to find the position of the tags

    the output should be like

    Code:
    1---5-7
    1---5--8
    or any similar format like 1;5;7


    Thanks in advance for any help

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    Homework? Also, your example output makes no sense. Are you considering end-tags the same as start tags?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •