現在、この形式 (2 列のタブ "\t" で区切られている) と ";" で区切られたファイルがあります。列内のすべての要素を分離します)。
User\tDate
Alice Cooper;John Smith\t07/11/2019
Alice Cooper\t23/11/2018
Alice Cooper\t21/11/2018
Alice Cooper\t26/11/2018
Alice Cooper\t26/11/2018
Alice Cooper;John Smith\t09/12/2018
Alice Cooper;John Smith\t09/12/2018
Alice Cooper;John Smith\t04/12/2018
Alice Cooper\t07/12/2018
Alice Cooper\t07/12/2018
次の OUTPUT ファイルを作成するための最適化されたマクロ (理想的には JavaScript) に関する考えがあれば教えてください。
User\tEarliest\tLatest\tDates_with_Most_Occurences\tMost_Occurence_Number
Alice Cooper\t21/11/2018\t07/11/2019\t26/11/2018;07/12/2018\t2
John Smith\t04/12/2018\t07/11/2019\t09/12/2018\t1
したがって、中間ステップ(現在手動で実行していますが、マクロにロールインしたいと考えています):
ステップ 1: 列 1 の Name 要素を分離する
(このようなものを与える):
User\tDate
Alice Cooper\t07/11/2019
John Smith\t07/11/2019
Alice Cooper\t23/11/2018
Alice Cooper\t21/11/2018
Alice Cooper\t26/11/2018
Alice Cooper\t26/11/2018
Alice Cooper\t09/12/2018
John Smith\t09/12/2018
Alice Cooper\t09/12/2018
John Smith\t09/12/2018
Alice Cooper\t04/12/2018
John Smith\t04/12/2018
Alice Cooper\t07/12/2018
Alice Cooper\t07/12/2018
ステップ 2: Col1 AZ と Col 2 を古い順に並べ替えます。次に、列 1 に基づいて列 2 の要素を結合します (次のようになります)。
User\tDate
Alice Cooper\t21/11/2018;23/11/2018;26/11/2018;26/11/2018;04/12/2018;07/12/2018;07/12/2018;09/12/2018;09/12/2018;07/11/2019;
John Smith\t04/12/2018;09/12/2018;09/12/2018;07/11/2019;
ステップ 3: 各行の Col2 の日付情報を取得し、EarliestDate、LatestDate、Dates_with_Most_Occurences、Most_Occurence_Number の 4 つの新しい列を作成します (次のようになります)。
User\tDate
Alice Cooper\t21/11/2018;23/11/2018;26/11/2018;26/11/2018;04/12/2018;07/12/2018;07/12/2018;09/12/2018;09/12/2018;07/11/2019;
John Smith\t04/12/2018;09/12/2018;09/12/2018;07/11/2019;
ステップ 4: Col2 (Date) を削除: 最終出力を与える:
User\tEarliestDate\tLatestDate\tDates_with_Most_Occurences\tMost_Occurence_Number
Alice Cooper\t21/11/2018\t07/11/2019\t26/11/2018;07/12/2018\t2
John Smith\t04/12/2018\t07/11/2019\t09/12/2018\t1
最終出力を作成するためのマクロのみが必要です。中間 (上記のステップ 1、2、3) は、私がやろうとしていることのロジックを示しているだけです。実際のソース ファイルは数千行になるので、EmEditor で何らかの方法で最適化できれば素晴らしいことです。