A new question to a new format of file i need broken up.
Last time i asked it was different, and I did not know how to reopen question.
1) Replace any "&" in file to "H"
2) Replace any "#" in file to "I" (Letter I)
3) Break file by $$$$$$$.
4) Use the second entry in the $$$$$$$$ as part of the file name
5) Remove the $$$$$$$$ from the new file
6) Place new file into a new directory
Parameters
$INDIR = /data/out/
$OUTDIR = /data/newout
Input file:
Name sad.123.sad
$$$$$$$$|I231_0081788682|
HEADER|INV|20180224|20180224||0004165036|0004165036|0081788682|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788682|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788682|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788682|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|0081788682|20|180182C02|20180118
&EADER|DELV|20180224|20180224||0004165036|0004165036|0081788682|||||||||||
#TEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788682|10|180211C01|20180121
#TEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788682|10|180503C02|20180219
#TEM|900001|20|87QS5930150|1381|9999|200|CS|0081788682|20|180181C01|20180118
#TEM|900002|20|87QS5930150|1381|9999|100|CS|0081788682|20|180182C02|20180118
$$$$$$$$|I231_0081788684|
HEADER|INV|20180224|20180224||0004165036|0004165036|0081788684|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788684|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788684|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788684|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|0081788684|20|180182C02|20180118
&EADER|DELV|20180224|20180224||0004165036|0004165036|0081788684|||||||||||
#TEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788684|10|180211C01|20180121
#TEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788684|10|180503C02|20180219
#TEM|900001|20|87QS5930150|1381|9999|200|CS|0081788684|20|180181C01|20180118
#TEM|900002|20|87QS5930150|1381|9999|100|CS|0081788684|20|180182C02|20180118
$$$$$$$$|I266_0081788699|
HEADER|INV|20180224|20180224||0004165036|0004165036|0081788699|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788699|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788699|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788699|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|0081788699|20|180182C02|20180118
&EADER|DELV|20180224|20180224||0004165036|0004165036|0081788699|||||||||||
#TEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788699|10|180211C01|20180121
#TEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788699|10|180503C02|20180219
#TEM|900001|20|87QS5930150|1381|9999|200|CS|0081788699|20|180181C01|20180118
#TEM|900002|20|87QS5930150|1381|9999|100|CS|0081788699|20|180182C02|20180118
Break into files (This sample above is 3)
1 File Should be named: I231_0081788682_02252018_051500.txt
HEADER|INV|20180224|20180224||0004165036|0004165036|0081788682|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788682|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788682|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788682|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|0081788682|20|180182C02|20180118
HEADER|DELV|20180224|20180224||0004165036|0004165036|0081788682|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788682|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788682|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788682|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|0081788682|20|180182C02|20180118
2) file: should be Should be named: I231_0081788684_02252018_051500.txt
HEADER|INV|20180224|20180224||0004165036|0004165036|0081788684|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788684|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788684|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788684|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|0081788684|20|180182C02|20180118
HEADER|DELV|20180224|20180224||0004165036|0004165036|0081788684|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788684|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788684|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788684|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|0081788684|20|180182C02|20180118
3) File name Should be named: I266_0081788699_02252018_051500.txt
HEADER|INV|20180224|20180224||0004165036|0004165036|0081788699|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788699|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788699|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788699|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|0081788699|20|180182C02|20180118
HEADER|DELV|20180224|20180224||0004165036|0004165036|0081788699|||||||||||
ITEM|900001|10|4L7S6101367|1381|9999|100|CS|0081788699|10|180211C01|20180121
ITEM|900002|10|4L7S6101367|1381|9999|100|CS|0081788699|10|180503C02|20180219
ITEM|900001|20|87QS5930150|1381|9999|200|CS|0081788699|20|180181C01|20180118
ITEM|900002|20|87QS5930150|1381|9999|100|CS|008178869|20|180182C02|20180118
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Expert of the Year award recognizes an expert who helped improve Experts Exchange in the past year through high levels of contributions and participation on site. This award is given to the expert who has achieved the highest levels of participation, while maintaining quality contributions and professionalism.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.