Hi. I have a text file (input.txt) that has thousands of lines like this: 0197-MP4-915_VBUUMP-Q9CR7 0198-MP4-915_V6YNZU-3Y331 02_12_18_UA8979-E48XG 0200-MP4-915_IBODWT-L01MD 1_2019-08-15_09-46-59_0SJFZH-PEYA0 1_2019-08-15_10-56-22_SDDSCI-THTQR I need help with python script that will strip all characters but only keep the last 12 characters in each line (output to output.txt) as from the above example: VBUUMP-Q9CR7 V6YNZU-3Y331 UA8979-E48XG 0SJFZH-PEYA0 SDDSCI-THTQR Thank you
Hi. I have a text file (input.txt) that has thousands of lines like this:
0197-MP4-915_VBUUMP-Q9CR7
0198-MP4-915_V6YNZU-3Y331
02_12_18_UA8979-E48XG
0200-MP4-915_IBODWT-L01MD
1_2019-08-15_09-46-59_0SJFZH-PEYA0
1_2019-08-15_10-56-22_SDDSCI-THTQR
I need help with python script that will strip all characters but only keep the last 12 characters in each line (output to output.txt) as from the above example:
VBUUMP-Q9CR7
V6YNZU-3Y331
UA8979-E48XG
0SJFZH-PEYA0
SDDSCI-THTQR
Thank you
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images