sql - document migration name extraction -
I have a scenario and I want to see that someone has a suggestion on how I should deal with it. Basically I have a directory that is full of files, in the name of the document [code] - [number] - [text]
code - a generic 3 letter Code is included. Number - A number usually in size of 4 - 5 size.
Text - The name of the original document (before it is dumped)
A colon (-) to code, NUMBER and TEXT. The number always starts with 5 characters.
I would like to scan that directory anyway and remove the number from the file name, then I would like to compare that number to the field in a database (SQL query is quite straight forward, also the form of raw text ) If the number matches the number in the database, then I want to separate those files.
If I want to clarify anything then please ask me I was not sure this site is suitable for my query. Open the root folder, click in the File Explorer Path (to open that place in the open space, so that the whole To highlight the path), type cmd
and press enter
to open a command prompt from that folder location. / P>
Type: dir / b / s & gt; You can exclude
/ s
to get a list of all file names in filelist.txt if you do not have / need not to dig in subfolders.
I will paste it into Excel, if you have 2013 then you can just start typing the part you want to remove, when you type the whole first line when typing the next line This will recognize the pattern and you can simply press enter
to fill.
Otherwise, Data & gt; Specify the text in the column as
and -
as a delimiter.
In the same way, you can only import the fileslist, by using SUBSTRING () in the SQL
> or similar when you have your matching names. You can use some coding only to make a COPY
or MOVE
.bat file, in SQL or Excel very easy.
Comments
Post a Comment