Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Re: finding substring from index a to b

  •  10-01-2007, 5:14 PM

    Re: finding substring from index a to b

    Actually, I just figured out a very sweet way of doing this ...

     

    Doesn't neet any complicated pattern match at all ... I just need to use 'head -c <num>' and get the top <num> characters from a file and then pipe it to 'tail -c <num>' to get the bottom <num> characters.

     

    Keeping Susan's (first) explanation in mind (and counting 1 character extra in each <num> for each \n the input file, the substring can be extracted from any large file very easily!

     

    Only that, I would have had to do some regular expression matching if I was looking for a pattern, but I am not looking for any in this case, and so head and tail work perfectly fine for me - especially since the input files are very large.

     

    Thanks everyone for your help! :)

     

    Filed under:
View Complete Thread