Search Results

Search found 34 results on 2 pages for 'bala3569'.

Page 2/2 | < Previous Page | 1 2 

  • compare two text files using linq?

    - by bala3569
    I have 4 text files in one folder and a pattern.txt to compare these text files..In pattern.txt i have insert update delete drop I need to compare this text file with those four text files and if these patterns matches any line in that text files i have to write those lines in another log file...i had read those files using linq..i need to compare those files and write in a text file with line number..here is my code var foldercontent = Directory.GetFiles(pathA) .Select(filename => File.ReadAllText(filename)) .Aggregate(new StringBuilder(), (sb, s) => sb.Append(s).Append(Environment.NewLine), sb => sb.ToString()); var pattern = File.ReadAllLines(pathB).Aggregate(new StringBuilder(), (sb, s) => sb.Append(s).Append(Environment.NewLine), sb => sb.ToString()); using (var dest = File.AppendText(Path.Combine(_logFolderPath, "log.txt"))) { //dest.WriteLine("LineNo : " + counter.ToString() + " : " + "" + line); } EDIT I have already used c# to compare two text files but i need this in linq while ((line = file.ReadLine()) != null) { if (line.IndexOf(line2, StringComparison.CurrentCultureIgnoreCase) != -1) { dest.WriteLine("LineNo : " + counter.ToString() + " : " + " " + line.TrimStart()); } counter++; } file.BaseStream.Seek(0, SeekOrigin.Begin); counter = 1;

    Read the article

  • What is wrong in this json string?

    - by bala3569
    My json string looks like this, {"id" : "38","heading" : "Can you also figure out how to get me back the 10 hours I sp.....","description" : "Im having a very similar problem with the Login control - again it always generates a default style containing border -collapse -only in this case .....","img_url" : "~/EventImages/ EventImages1274014884460.jpg","catogory" : "News","doe" : "15-05-2010 "} But get the error, unterminated string literal.... EDIT: I used this but it didn't work, var newjson = cfreturn( """" & ToString( HfJsonValue ).ReplaceAll( "(['""\\\/\n\r\t]{1})", "\\$1" ) & """" ) ; var jsonObj = eval('(' + newjson + ')'); Error: missing ) after argument list Source Code: var newjson = cfreturn( """" & ToString( HfJsonValue ).ReplaceAll( "(['""\\\/\n\r\t]{1})", "\\$1" ) & """" ) ;

    Read the article

  • What is wrong with this javascript?

    - by bala3569
    i use this javascript syntax for validating a checkbox... alert(document.getElementById("ctl00_ContentPlaceHolder1_Chkreg").checked); if (document.getElementById("ctl00_ContentPlaceHolder1_Chkreg").checked == false) { document.getElementById("ctl00_ContentPlaceHolder1_ErrorMsg").innerHTML = "please select the checkbox"; document.getElementById("ctl00_ContentPlaceHolder1_Chkreg").focus(); return false; } My alert showed me false but my if loop is not working... Any suggestion...

    Read the article

  • How to get this done in mysql?

    - by bala3569
    Consider i have a registartion table and there is field prefLocationId and it contains value like this 1,2,3,2,1,4 and so many.... And i have a table prefLocation which looks like this Id LocationName 1 Chennai 2 Mumbai 3 Kolkatta 4 Delhi and i want to select record of users and show values like Chennai,Mumbai,Kolkatta,Mumbai,Chennai,Delhi and so on...

    Read the article

  • Why abstract classes necessary?

    - by bala3569
    1.What is the point of creating a class that can't be instantiated? Most commonly to serve as a base-class or interface (some languages have a separate interface construct, some don't) - it doesn't know the implementation (that is to be provided by the subclasses / implementing classes) 2.Why would anybody want such a class? For abstraction and re-use 3.What is the situation in which abstract classes become NECESSARY?can anyone brief it with an example?

    Read the article

< Previous Page | 1 2