15,890,512 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Himansh jain (Top 32 by date)
Himansh jain
27-Sep-22 0:51am
View
I am sorry, I will try to be more clear from the next time.
Himansh jain
20-Sep-22 7:50am
View
Sir, actually when I am directly hitting the API, I am able to view the file .
But when I am hitting it from UI
$scope.download = function (fileName) {
debugger
if (fileName != null && fileName != '' && fileName != undefined) {
URIService.GetData(URIService.GetDownloadExcelFileUrl(fileName))
.success(function (data) {
var file = new Blob([data], {
type: 'application/vnd.ms-excel'
});
FileSaver.saveAs(file, fileName, true); //I need help over this piece of code , when the data is being returned from api , while saving that data..format issue arises.
}).error(function (data, status, headers, config) {
var errorMessage = "";
if (status == "404" || data == undefined) {
errorMessage = "Menu.FileNotFound"
}
else {
errorMessage = "Menu.Error_Message"
}
});
Himansh jain
20-Sep-22 7:41am
View
you can try putting null check
Himansh jain
20-Sep-22 7:29am
View
But Through directly hitting the API I am able to download the xls file correctly.
Only when I am hitting API through the angularjs code, i am seeing this. So the issue must be with angularjs code.
Himansh jain
20-Sep-22 7:20am
View
Sir, can you please debug this code..I am not able to download the correct file.
Please refer to the question below.
https://www.codeproject.com/Questions/5342610/How-do-I-download-a-file-in-xls-format
Himansh jain
20-Sep-22 7:12am
View
anything can be used ..by default I put the strings..it can be modified according to his requirement.
Himansh jain
20-Sep-22 6:34am
View
https://drive.google.com/file/d/1ROFq9mj2AqsHd7u2j6KESBTn5W24zj3p/view?usp=sharing
Please find the screenshot of the file when I try to open it.
Himansh jain
19-Sep-22 5:45am
View
I am getting responses like this. When I open it through open in a new tab through response(by pressing F12), a new excel file in xls file format gets downloaded which opens correctly.
Himansh jain
19-Sep-22 5:43am
View
��ࡱ�
Himansh jain
19-Sep-22 4:52am
View
So what am I doing wrong?
Himansh jain
19-Sep-22 4:40am
View
Like this
???????
%??????????????????id???????????????timesNewRoman???????????????????????????????
Himansh jain
4-Jun-22 5:34am
View
Deleted
what to add ?
public NutShellContext()
{
???
}
Himansh jain
4-Jun-22 5:19am
View
Please tell me ,where am I making mistake.
Himansh jain
4-Jun-22 4:38am
View
dbContext.Customers.Add(cust); on this line
Himansh jain
16-May-22 7:03am
View
- $exception {"Cannot create a file when that file already exists."} System.IO.IOException
i am getting this exception
Himansh jain
28-Jan-22 23:30pm
View
DateTime? InstallDate = '25-01-2022 13:27:36';
I have to convert it into format(yyyy/mm/dd hh:mm:ss) as my database where I have to insert the InstallDate takes only the (yyyy/mm/dd hh:mm:ss) format.
Desired Output
InstallDate = '2022-01-25 13:27:36'
Please provide the code if you can figure this! Thankyou for your support.
Himansh jain
28-Jan-22 23:29pm
View
DateTime? InstallDate = '25-01-2022 13:27:36';
I have to convert it into format(yyyy/mm/dd hh:mm:ss) as my database where I have to insert the InstallDate takes only the (yyyy/mm/dd hh:mm:ss) format.
Desired Output
InstallDate = '2022-01-25 13:27:36'
Please provide the code if you can figure this! Thankyou for your support.
Himansh jain
28-Jan-22 23:28pm
View
DateTime? InstallDate = '25-01-2022 13:27:36';
I have to convert it into format(yyyy/mm/dd hh:mm:ss) as my database where I have to insert the InstallDate takes only the (yyyy/mm/dd hh:mm:ss) format.
InstallDate = '2022-01-25 13:27:36'
Please provide the code if you can figure this! Thankyou for your support.
Himansh jain
27-Jan-22 7:58am
View
Here the variable is InstallDate not MeterInstallDate
Himansh jain
30-Aug-21 7:26am
View
Select Id,ExtractName,NextRunTime from ExtractSchedule e join ExtractDefinition u on e.ExtractID=u.Id order by u.id desc;
Is this correct?
Himansh jain
25-Jun-21 5:26am
View
thank you Sir :)
Himansh jain
24-Jun-21 7:42am
View
thank you:)
Himansh jain
24-Jun-21 6:53am
View
thank you for your solution . Could you please tell where I can study about "Descendants("G1").First()?.Value" usage...i was going through documentation but could not find it .
Himansh jain
24-Jun-21 6:39am
View
still it is not working...what to do?
Himansh jain
21-Jun-21 7:19am
View
Sorry , you were right . Thanks a ton. :)
Himansh jain
21-Jun-21 6:54am
View
Sir , i followed your suggestion only
using System;
using System.Xml;
using System.IO;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Linq;
namespace ReadXML
{
class Program
{
static void Main(string[] args)
{
AnalyzeFiles(Path.GetDirectoryName(@"C:\Users\himansh.jain\Downloads\cesu\"));
}
static IEnumerable<string> GetCodes(string filename)
{
var xml = File.ReadAllText(filename);
return Regex
.Matches(xml, @"P\d -\d -\d -\d -\d")
.Select(x => x.Value)
.Distinct()
.ToList();
}
static void AnalyzeFiles(string path)
{
var filenames = Directory.GetFiles(path, "*.xml");
foreach (var filename in filenames)
{
var codes = GetCodes(filename);
var destinationFilename = Path.Combine(path, $"{Path.GetFileNameWithoutExtension(filename)}_result.txt");
File.WriteAllLines(destinationFilename, codes);
}
}
}
}
But I am getting 0 byte size txt files therefore could not find those codes in them.
Himansh jain
21-Jun-21 6:39am
View
This code is running fine...the one you helped with before. Here I am getting values in my txt files.
using System;
using System.Xml;
using System.IO;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Linq;
namespace ReadXML
{
class Program
{
static void Main(string[] args)
{
var path = @"C:\Users\himansh.jain\Downloads\cesu";
foreach (var file in System.IO.Directory.GetFiles(path))
{
var xml = File.ReadAllText(file);
Console.WriteLine(file);
var codes = Regex.Matches(xml, @"P\d-\d-\d-\d-\d");
List<string> list = new List<string>();
foreach (var code in codes)
{
string s = Convert.ToString(code);
list.Add(s);
}
List<string> uniqueList = list.Distinct().ToList();
var destinationFilename = Path.Combine(path, $"{Path.GetFileNameWithoutExtension(file)}_result.txt");
File.WriteAllLines(destinationFilename, uniqueList);
}
Console.ReadLine();
}
}
}
Himansh jain
21-Jun-21 6:27am
View
thank you for your solution , but now i am getting empty txt files. Value of ,
Codes
is not getting written in the text files.
Himansh jain
21-Jun-21 3:59am
View
Thank you very much
Himansh jain
21-Jun-21 3:37am
View
thank you for your solution but still i am not able yo print the result
string path = @"C:\Users\himansh.jain\Downloads\Xmltesting1.xml";
var xml = File.ReadAllText(path);
var codes = Regex.Matches(xml, @"P\d-\d-\d-\d-\d");
Console.WriteLine(codes);
After Running the above code I am getting this...i don't know why i am not able to print the result.
System.Text.RegularExpressions.MatchCollection
C:\Users\himansh.jain\source\repos\readxmls\bin\Debug\netcoreapp3.1\readxmls.exe (process 34808) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
Himansh jain
21-Jun-21 3:37am
View
Deleted
thank you for your solution but still i am not able yo print the result
string path = @"C:\Users\himansh.jain\Downloads\Xmltesting1.xml";
var xml = File.ReadAllText(path);
var codes = Regex.Matches(xml, @"P\d-\d-\d-\d-\d");
Console.WriteLine(codes);
After Running the above code I am getting this...i don't know why i am not able to print the result.
System.Text.RegularExpressions.MatchCollection
C:\Users\himansh.jain\source\repos\readxmls\bin\Debug\netcoreapp3.1\readxmls.exe (process 34808) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
Himansh jain
21-Jun-21 3:17am
View
XmlDocument doc = new XmlDocument();
doc.Load("C:\\Users\\himansh.jain\\Downloads\\Xmltesting1.xml");
string pattern = @"P\d-\d-\d-\d-\d";
Regex rgx = new Regex(pattern);
foreach (Match match in rgx.Matches(doc))
Console.WriteLine("'{0}'",match.Value);
i could not make it work , can you please identify the error.
Show More