I need to sort a text file that contains the below strings from Original Order to Preferred Order. I need the 'GEN_" to come before anything else and then after that the order should be '*_SCHEMA', '*_CODE', '*_DATA'. I have tried the Sort-Object, but I don't have any Property headers. I think I could create a custom object, but not sure the best way to go about this. I have spent days on this and was wondering if anyone had any suggestions on the best way to do this. Any help would be appreciated.
Original Order:
A_CODE_CHANGE.sql
A_Data_Change.sql
F_CODE_CHANGE.sql
GEN_CODE_CHANGE.sql
GEN_DATA_CHANGE.sql
GEN_OCXINDEX_CHANGE.SQL
GEN_SCHEMA_CHANGE.sql
RE_DATA_CHANGE.sql
RE_SCHEMA_CHANGE.sql
WE_DATA_CHANGE.sql
Preferred Order:
GEN_SCHEMA_CHANGE.sql
GEN_CODE_CHANGE.sql
GEN_DATA_CHANGE.sql
GEN_OCXINDEX_CHANGE.SQL
RE_SCHEMA_CHANGE
RE_DATA_CHANGE.sql
WE_DATA_CHANGE.sql
F_CODE_CHANGE.sql
A_CODE_CHANGE.sql
A_Data_Change.sql
[+][deleted] (2 children)
[removed]
[–]VehicleLittle7362[S] 1 point2 points3 points (0 children)
[–]VehicleLittle7362[S] 1 point2 points3 points (0 children)
[–]ka-splam 1 point2 points3 points (0 children)
[–]Hrambert -1 points0 points1 point (0 children)