User Profile

Collapse

Profile Sidebar

Collapse
tariqondego
tariqondego
Last Activity: Jun 3 '14, 12:15 PM
Joined: Jun 3 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I have solved this:added a positive look ahead to the expression.(?=. ..)
    string[] lines = System.Text.Reg ularExpressions .Regex.Split(ke ep, @"(?=\s\s\s\d\d \/\d\d\/\d\d\s\d\d\:\d\ d\s\s\w\w\d\d\d \d\d\d)");
    foreach (string line in lines)
    { sw.WriteLine(li ne); }
    See more | Go to post

    Leave a comment:


  • Split line based on specific pattern using Regex

    i need to split lines in text file based on a specific pattern.The pattern is " 01/12/12 00:39 AT400003".

    The source file looks like:

    AT400003 2012-12-01 00:36:03.000 abcdefghij 01/12/12 00:39 AT400003 abcdefjhij 01/12/12 01:39 AT400003 abcdefghij 01/12/12 00:39 AT400003 abcdefjhij

    I need the output file to look like:

    AT400003 2012-12-01 00:36:03.000 abcdefghij...
    See more | Go to post
No activity results to display
Show More
Working...