locked
VBScript for regrouping the content of text files on the basis of first and second column value in another text files RRS feed

  • General discussion

  • Hello,

    I have one requirement for grouping the content of text files (basically lines consist of some columns delimited by :). I tried with vbscript but it didn't work. Can anyone please help me on that.

    Below is the requirement:

    I have one master.txt files which consist of below content:

    2019:T01:Actual:A1101:P1101:D68:289

    2018:T02:Actual:A1101:P1101:D68:289

    2019:T01:Actual:A2101:P1101:D58:289

    2019:T02:Actual:A1101:P1101:D68:289

    2019:T02:Actual:A1301:P1101:D68:289

    2018:T02:Actual:A2101:P1101:D68:289

    I want output like below:

    2018_T02.txt file should have below:

    2018:T02:Actual:A2101:P1101:D68:289

    2018:T02:Actual:A1101:P1101:D68:289

    2019_T01.txt file should have below:

    2019:T01:Actual:A1101:P1101:D68:289

    2019:T01:Actual:A2101:P1101:D58:289

    2019_T02.txt file should have below:

    2019:T02:Actual:A1101:P1101:D68:289

    2019:T02:Actual:A1301:P1101:D68:289

    • Changed type Bill_Stewart Tuesday, April 14, 2020 4:55 PM
    • Moved by Bill_Stewart Tuesday, April 14, 2020 4:56 PM This is not "scripts on demand"
    Thursday, October 17, 2019 5:59 PM

All replies