Note that there are some explanatory texts on larger screens.

plurals
  1. POReading files using system.io?
    text
    copied!<p>Could do with some help with this question.I am using the system.io, and I have to do things which require files to be moved, grouped, renamed. .</p> <p>Working in command line application using c# so far I have moved some files from one directory to another, I now need to group some pdf files like so - B-12345 1.pdf, B-12345 2.pdf, B-12345 3.pdf, B-12345 4.pdf.I have been told I dont need to physically group them together just for the purposes of ensuring I only create one job per project reference(b-1234).</p> <p>To give you a bit of background info on what im doing after these files are grouped I need to create a record in the job table sql database.But thats another question for another day just thought id give you some more info.</p> <p><strong>Mainly I just need info on how to read files that are in a file directory and grouping files, this would be very beneficial to me.?</strong></p> <p>To make the question a bit clearer this is the order in tasks should be done in the command line app.</p> <ol> <li>Read files in directory (I have moved them so unsure on this?)</li> <li>Group by project no (unsure)</li> <li>Create job record in sql db </li> <li>Move and rename file to correct location</li> </ol> <p>Thanks in advance</p> <p>My code is below</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; public class MoveForProcessing { static void Main() { // move cad jobs to processing directory and delete former folder, use the System.IO.Path class. System.IO.Directory.Move(@"C:\Users\Ben\My Documents\Temp\", @"C:\Users\Ben\My Documents\Processing\"); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload