|
We have some list of files to copy from a ftp server. Sometimes the file in the source folder have files arrived on same date but @ different time
and I would like to copy only latest file for each date. Ex:
abc_sky_2014-01-15XYZ03-05-00.Dat
abc_sky_2014-01-15XYZ03-08-00.Dat
abc_sky_2014-01-16XYZ008-10-00.Dat
abc_sky_2014-01-16XYZ008-13-00.Dat
abc_sky_2014-01-16XYZ008-16-00.Dat
From above files I want to fetch only the latest files for each date : abc_sky_2014-01-15XYZ03-08-00.Dat, abc_sky_2014-01-16XYZ008-16-00.Dat
Can someone please help.
|
|
|
|
|
There is no "simple" built-in way to do that.
You will have to read all the file names, and group them by name and date. You can then easily sort the times.
I'd suggest using a regex to "split" the file name from the date and time, then using Linq to group the values.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
var directory = new DirectoryInfo(@"F:\Root\");
var files = from f in directory.EnumerateFiles("*.dat")
group f by f.Name.Substring(0, 21) into g
select g.Last();
foreach (var file in files)
{
Console.WriteLine(file.Name);
}
|
|
|
|
|
Hello everyone. I want to develop a small application in Windows Form Application using VS Community 2015. I need to create some forms and then export them in a pdf file for printing. The problem is that I have to create the form to fit exactly in a A4 paper width and height. What tools do you recommand me to use or which do you think is the best approach?
|
|
|
|
|
Use a PrintDocument[^] - you have complete control over the exact placement of everything.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank you, I will try with that..
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Ok so I have a problem. I have to create the form of the page with multiple data which will be inserted from textboxes and labels. I need to arrange them and in the final, I found a way to create more pages if is necessary. But I can't set the height of the windows forms larger than 780 and I really don't know why ) Is there any way to create a structure for the form specially for printing? I'm kinda beginner with this type of projects..
|
|
|
|
|
Hi,
I'm trying to build a logic analyzer - style chart with minimum 16 lines. I so far took a chart and added 16 chart areas, 16 series and 16 titles. The chart areas are all aligned to the first one.
What I need to add is a
1. "general" horizontal and vertical scrollbar and a horizontal scale
2. a zoom and pan function via mousewheel
3. at least two cursors whith automatic "delta" display
for 1. I tried adding the scale and the scrollbar to the bottom chart area, but this results in a changing display of the line as soon as a scrollbar gets visible. Of course all lines should scroll together. I imagined something like scrollbars for the chart not for the chartArea but that doesn't exist, right ?
The vertical scrollbar should be visible if there are more lines than can be displayed in the current window, but the first problem is that chart areas can only be added in relation to the chart height from 0-100 % , not more. Should I use something else than chartareas?
2. for example strg+wheel for zoom and alt+wheel for pan (scroll) should I use a keypressed/keydown event ?
3. no idea yet, the only visible cursors so far are the ones when click and drag which results in a automatic zoom currently
can anyone give me some hints for the different problems ?
Thank you very much,
Mat
modified 28-Jul-15 4:18am.
|
|
|
|
|
ok, point 2. done, this leaves 1. and 3. ...
no one ?
|
|
|
|
|
How do I use the repisitory pattern in Mvc tamplate
|
|
|
|
|
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
A very quick search using your question as the search term gave nearly half a million hits: Google "How do I use the repisitory pattern in Mvc tamplate"[^]
In future, please try to do at least basic research yourself, and not waste your time or ours.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Completely agree with my friend's comment above.
But assuming that you are new to this world, be my guest and have a look into this article.
http://www.codeproject.com/Articles/631668/Learning-MVC-Part-Repository-Pattern-in-MVC-App
But please from next time, time to do some basic research first.
|
|
|
|
|
HI,
I want to know that What is anonymous method in C# and it's use???
|
|
|
|
|
|
have a look into this
http://www.codeproject.com/Articles/47887/C-Delegates-Anonymous-Methods-and-Lambda-Expressio
|
|
|
|
|
hi , for example i have a table named (name)
and a form with a text box and a add button.
i wanna know how do i transfer the data from the textbox into the table( sql server express 2012 , and visual studios 2015 Rc)
sql connecton ......
sqlcommand cmd = new sqlcommand("insert into* .......... <- the part im struggling with
|
|
|
|
|
|
thanks il quickly take a look there
|
|
|
|
|
Have you bought the C# book you were recommended yet?
|
|
|
|
|
not yet my finances are kinda flat up now
|
|
|
|
|
So what structured resources are you following to learn C# properly?
|
|
|
|
|
i got a few pdfs i read thru that i got from my friend studying c# ,
|
|
|
|
|
There's a really good free PDF-book on programming in C#, which you can download here: http://www.introprogramming.info/[^]
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
thanks man
|
|
|
|