Hello, I hope someone can help me. I am trying to parse data from a txt file and output the results to a new file with timestamp in the name of the file.
The format of the txt file is ";" delimited and is several thousand records in length. Below is an example of the .txt format. PACE | EVDOPCMD | 33.0 | 101218 | 07 | 8;1023240136;1218;0;1;00a000001a2bcdc7;0310003147702376;ac016d4a;;;5.6.128.8;0;;;;;43234169;43234349;;;10000;1;1;;0;;19;5.6.128.22;172.30.151.5;304;3;304;3;;;;;15;175;15;175;15;175;1;1798;1251;0;0;2;19;20;;;;;1;1;1;0;128;5.6.128.8;;;;;;;301;5.6.128.8;;;8;304;3;;;;1;43244037;;;1;18;43234169;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1;;;;;;43234416;0;0;304;3;21;19;175;15;405;1;1;1;1;0;125;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;|;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| 8;1023240137;1218;0;1;00a000001db74ace;;ac0174ca;43243423;1678442111;5.6.128.8;1;0;;43242544;43244207;43243423;43243647;;;1000;1;1;;0;;19;5.6.128.26;;372;2;372;2;;43243012;0;43243562;15;175;15;175;15;175;1;;;;;5;48;19;20;49;50;;0;1;2;0;68;5.6.128.8;;;;;;;301;5.6.128.8;;;8;372;2;;;;1;43244207;;;1;18;43243423;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1;;;;;;43242544;0;0;372;2;21;19;175;15;177;3;1;0;0;0;68;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;|43243753;0;0;372;2;21;19;175;15;177;3;1;1;1;0;71;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| 8;1023240138;1218;0;1;00a000002017ccdb;0310003147833882;aca344d7;;;5.6.128.13;0;;;;;43234160;43234358;;;10000;1;1;;0;;19;5.6.128.31;172.30.151.5;320;2;320;2;;;;;15;75;15;75;15;75;1;2162;1317;0;0;2;19;20;;;;;1;1;1;0;104;5.6.128.13;;;;;;;306;5.6.128.13;;;8;320;2;;;;1;43244164;;;1;18;43234160;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1;;;;;;43234404;0;0;320;2;21;19;75;15;279;6;1;1;1;0;64;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;|;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| 8;1023240139;1218;0;1;00a1000009237b21;0310003147774000;aca3141e;;;5.6.128.13;0;;;;;43235644;43235820;;;9000;1;1;;0;;19;5.6.128.19;172.30.151.5;502;1;502;1;;;;;15;175;15;175;15;175;1;48;79;0;0;2;19;20;;;;;1;1;1;0;124;5.6.128.13;;;;;;;306;5.6.128.13;;;8;502;1;;;;1;43244194;;;1;18;43235644;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1;;;;;;43235887;0;0;502;1;21;19;175;15;27;1;1;1;1;0;127;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;|;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;| I am very new to perl so any help is appreciated. Ideally I would like to extract the following columns 0, 5, 44, 31, 32, and give them the following headers indicated below. %fieldmap = ( "Version" => 0, "MType" => 5, "RLPtxAT" => 44, "Cell" => 31, "Sector" => 32, ); Thank you, Chris