提取为单个字符串
Number 1:
Number 2: 55-60(a)
Number 3: 43/32455, 225(c), 26/10533-10541
Number 4: 234(b)
Number 5:
Number 6: 643/54231
Number 7: 10(a), 162(b)
Number 8: 742/12345,12346
(c=cross,b=bold,a=alpha)
值为“数字4”的数字将是234c4 等等:
Number 4: 234(b)
"4" or any digit with Number [0-9], will be concatenated with c = c + 4
234 is the value for the Number 4, then 234 + c4 = 234c4 (flagged as b = bold)
Number 6: 643/54231
value without any flag will be sorted into the cross column along with cross tag (c)
Sorted :
cross
43c3@SP32455;225c3;643c6@SP54231
打印范围
Number 2: 55-60(a)
Sorted :
alpha
55c2;56c2;57c2;58c2;59c2;60c2
Number 3: 26/10533-10541
cross
26c3@SP10533;26c3@SP10534;26c3@SP10535;26c3@SP10536;26c3@SP10537;26c3@SP10538;26c3@SP10539;26c3@SP10540;26c3@SP10541
一旦列出所有标记的输出(alpha、bold、cross/a、b、c)。 等等:
a / alpha =
55c2;56c2;57c2;58c2;59c2;60c2;10c7
b / bold =
234c4;162c7
c / cross =
43c3@SP32455;225c3;26c3@SP10533;26c3@SP10534;26c3@SP10535;26c3@SP10536;26c3@SP10537;26c3@SP10538;26c3@SP10539;26c3@SP10540;26c3@SP10541;643c6@SP54231;742c8@SP12345;742c8@SP12346
它将合并成一行作为预期输出(逗号分隔),如下所示
a,b,c
55c2;56c2;57c2;58c2;59c2;60c2;10c7,234c4;162c7,43c3@SP32455;225c3;26c3@SP10533;26c3@SP10534;26c3@SP10535;26c3@SP10536;26c3@SP10537;26c3@SP10538;26c3@SP10539;26c3@SP10540;26c3@SP10541;643c6@SP54231;742c8@SP12345;742c8@SP12346
交叉检查的细目:
alpha
55c2;56c2;57c2;58c2;59c2;60c2;10c7
bold
234c4;162c7
cross
43c3@SP32455;225c3;26c3@SP10533;26c3@SP10534;26c3@SP10535;26c3@SP10536;26c3@SP10537;26c3@SP10538;26c3@SP10539;26c3@SP10540;26c3@SP10541;643c6@SP54231;742c8@SP12345;742c8@SP12346
现在,我使用一行脚本打印范围
for a in {10533..10541}; do echo $a | awk '{printf "26c3@SP%s;",$0}'; done
这是纯awk中的一个解决方案。它不是特别可读,我不相信awk是这个特殊情况下工作的正确工具。可能需要调整一些模式和/或行动。我是根据您的具体案例来制定解决方案的
相关问题 更多 >
编程相关推荐