问题描述
我有两个字段
DepartmentNumber 99个字符的文本
DepartmentDesc。 255个字符的文字。
一些数据样本:我有近20000条记录。
DepartmentNumber为空,没有数据。
DepartmentDesc充满了休闲数据。
Department1 / Center1 / Section1 / SubSection1 ...有时最多可以达到7个子级。
Department1 / Center1 / Section1 / SubSection2 ......有时它最多可以达到7个子级。
Department1 / Center1 / Section1 / SubSection3 ...有时最多可以达到7个子级。
Department1 / Center1 / Section2 / SubSection1 ...有时最多可以达到7个子级。
Department1 / Center1 / Section2 / SubSection2 ...有时最多可以达到7个子级。
Department1 / Center1 / Section2 / SubSection3 ...有时它最多可以达到7个子级。
Department1 / Center1 / Section2 / SubSection4 ...有时最多可以达到7个子级。
Department1 / Center1 / Section2 / SubSection5 ...有时它最多可以达到7个子级。
Department1 / Center2 / Section1 / SubSection1 ...有时它最多可以达到7个子级。
Department1 / Center2 / Section1 / SubSection2 ...有时最多可以达到7个子级别。
Department1 / Center2 / Section2 / SubSection1 ...有时最多可以达到7个子级别。
Department1 / Center2 / Section3 / SubSection1 ...有时最多可以达到7个子级别。
Department1 / Center2 / Section4 / SubSection1 ...有时它最多可以达到7个子级。
Department1 / Center2 / Section4 / SubSection2 ...有时最多可以达到7个子级别。
Department2 / Center1 / Section1 / SubSection1 ...有时它可以达到7个子级别。
Department2 / Center1 / Section1 / SubSection2 ...有时最多可以达到7个能级。
Department2 / Center1 / Section1 / SubSection3 ...有时最多可以达到7个子级。
Department2 / Center1 / Section2 / SubSection1 ...有时最多可以达到7个子级别。
Department2 / Center1 / Section2 / SubSection2 ...有时它最多可以达到7个子级。
Department2 / Center1 / Section2 / SubSection3 ...有时最多可以达到7个子级别。
Department2 / Center1 / Section2 / SubSection4 ...有时最多可以达到7个子级。
Department2 / Center1 / Section2 / SubSection5 ...有时最多可以达到7个子级别。
Department2 / Center2 / Section1 / SubSection1 ...有时它最多可以达到7个子级。
Department2 / Center2 / Section1 / SubSection2 ...有时最多可以达到7个子级别。
Department2 / Center2 / Section2 / SubSection1 ...有时最多可以达到7个子级。
Department2 / Center2 / Section3 / SubSection1 ...有时最多可以达到7个子级别。
Departme nt2 / Center2 / Section4 / SubSection1 ...有时它最多可以达到7个子级。
Department2 / Center2 / Section4 / SubSection2 ...有时最多可以达到7个子级别。
我的需求是:
我想给所有这些部门,中心,部门和小节提供数字。每个部分将采用3位数字。 Department = 000,Center = 000,Section = 000 ......等
这里的分隔符是数据之间的斜杠符号/。
具有相同部门的行将有部门的相同三位数代码,中心累计数字,001 002 003等。
同一部门的相同中心将具有相同的三位数代码和部分累计数字,001 002 003等。
同一中心和部门的相同部分将具有相同的三位数代码累计编号,分别为001 002 003等。等等所有子级别。
所以在一天结束时,我的部门号码将是这样的:
Department1 / Center1 / Section1 / SubSection1 ... 00100100100100000000000000 ... 000
Department1 / Center1 / Section1 / SubSection2 ... 00100100100200000000000000 ... 000
Department1 / Center1 / Section1 / SubSection3 ... 00100100100300000000000000 ... 000
Department1 / Center1 / Section2 / SubSection1 ... 001001002001000000000000000000 ... 000
Department1 / Center1 / Section2 / SubSection2 ... 00100100200200000000000000 ... 000
Department1 / Center1 / Section2 / SubSection3 ... 00100100200300000000000000 ... 000
Department1 / Center1 / Section2 / SubSection4 ... 00100100200400000000000000 ... 000
Department1 / Center1 / Section2 / SubSection5 ... 00100100200500000000000000 ... 000
Department1 / Center2 / Section1 / SubSection1 ... 00100200100100000000000000 ... 000
Department1 / Center2 / Section1 / SubSection2 ... 00100200100200000000000000 ... 000
Department1 / Center2 / Section2 / SubSection1 ... 00100200200100000000000000 ... 000
Department1 / Center2 / Section3 / SubSection1 ... 00100200300100000000000000 ... 000
Department1 / Center2 / Section4 / SubSection1 ... 00100200400100000000000000。 .. 000
Department1 / Center2 / Section4 / SubSection2 ... 00100200400200000000000000 ... 000
I have two fields
DepartmentNumber text of 99 characters
DepartmentDesc. Text of 255 characters.
Sample of some data: I have almost over than 20000 records.
DepartmentNumber is empty, have no data.
DepartmentDesc is full of data like the fallow.
Department1/Center1/Section1/SubSection1 … sometimes it can reach up to 7 sublevels.
Department1/Center1/Section1/SubSection2 … sometimes it can reach up to 7 sublevels.
Department1/Center1/Section1/SubSection3 … sometimes it can reach up to 7 sublevels.
Department1/Center1/Section2/SubSection1 … sometimes it can reach up to 7 sublevels.
Department1/Center1/Section2/SubSection2 … sometimes it can reach up to 7 sublevels.
Department1/Center1/Section2/SubSection3 … sometimes it can reach up to 7 sublevels.
Department1/Center1/Section2/SubSection4 … sometimes it can reach up to 7 sublevels.
Department1/Center1/Section2/SubSection5 … sometimes it can reach up to 7 sublevels.
Department1/Center2/Section1/SubSection1 … sometimes it can reach up to 7 sublevels.
Department1/Center2/Section1/SubSection2 … sometimes it can reach up to 7 sublevels.
Department1/Center2/Section2/SubSection1 … sometimes it can reach up to 7 sublevels.
Department1/Center2/Section3/SubSection1 … sometimes it can reach up to 7 sublevels.
Department1/Center2/Section4/SubSection1 … sometimes it can reach up to 7 sublevels.
Department1/Center2/Section4/SubSection2 … sometimes it can reach up to 7 sublevels.
Department2/Center1/Section1/SubSection1 … sometimes it can reach up to 7 sublevels.
Department2/Center1/Section1/SubSection2 … sometimes it can reach up to 7 sublevels.
Department2/Center1/Section1/SubSection3 … sometimes it can reach up to 7 sublevels.
Department2/Center1/Section2/SubSection1 … sometimes it can reach up to 7 sublevels.
Department2/Center1/Section2/SubSection2 … sometimes it can reach up to 7 sublevels.
Department2/Center1/Section2/SubSection3 … sometimes it can reach up to 7 sublevels.
Department2/Center1/Section2/SubSection4 … sometimes it can reach up to 7 sublevels.
Department2/Center1/Section2/SubSection5 … sometimes it can reach up to 7 sublevels.
Department2/Center2/Section1/SubSection1 … sometimes it can reach up to 7 sublevels.
Department2/Center2/Section1/SubSection2 … sometimes it can reach up to 7 sublevels.
Department2/Center2/Section2/SubSection1 … sometimes it can reach up to 7 sublevels.
Department2/Center2/Section3/SubSection1 … sometimes it can reach up to 7 sublevels.
Department2/Center2/Section4/SubSection1 … sometimes it can reach up to 7 sublevels.
Department2/Center2/Section4/SubSection2 … sometimes it can reach up to 7 sublevels.
My needs are:
I want to give numbers to all of these departments, Centers, Sections and subsections. Each part will take 3 digits . Department = 000, Center = 000, Section =000 … etc.
My delimiter here is the slash sign "/" between data.
Rows with the same department will have the same three digits code for department, and accumulated number for center, 001 002 003 etc.
Same Centers with the same department will have the same three digits code and accumulated number for sections, 001 002 003 etc.
Same sections at the same center and department will have the same three digits code accumulated number for subsections, 001 002 003 etc.. And so on with all sublevels.
So at the end of the day my DepartmentNumber will be like this:
Department1/Center1/Section1/SubSection1 … 00100100100100000000000000... 000
Department1/Center1/Section1/SubSection2 … 00100100100200000000000000... 000
Department1/Center1/Section1/SubSection3 … 00100100100300000000000000... 000
Department1/Center1/Section2/SubSection1 … 00100100200100000000000000... 000
Department1/Center1/Section2/SubSection2 … 00100100200200000000000000... 000
Department1/Center1/Section2/SubSection3 … 00100100200300000000000000... 000
Department1/Center1/Section2/SubSection4 … 00100100200400000000000000... 000
Department1/Center1/Section2/SubSection5 … 00100100200500000000000000... 000
Department1/Center2/Section1/SubSection1 … 00100200100100000000000000... 000
Department1/Center2/Section1/SubSection2 … 00100200100200000000000000... 000
Department1/Center2/Section2/SubSection1 … 00100200200100000000000000... 000
Department1/Center2/Section3/SubSection1 … 00100200300100000000000000... 000
Department1/Center2/Section4/SubSection1 … 00100200400100000000000000... 000
Department1/Center2/Section4/SubSection2 … 00100200400200000000000000... 000
推荐答案
这篇关于字符串解析在命令编号链中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!