19
Jul
Problem description & analysis:The Excel table below is ordered by column A, whose values are strings separated by “-”. The first part of column A represents the category. Task: Store the table as multiple tab-separated txt files according to different categories. The file name format is Group_Category.txt.Group_AA.txt Group_BB.txt Group_CC.txt Solution:Use SPL IDE to execute the code: =T@b("data.xlsx").group(#1.split("-")(1);~).(T@b("Group_" / #1 / ".txt": #2)) Enter fullscreen mode Exit fullscreen mode Explanation:The T()function reads files as a table and writes a table to files; @ b means that column names are not included. group() function groups rows according to the specified rule and…