Forum Discussion

Hans_Olsson's avatar
Hans_Olsson
Copper Contributor
Jun 21, 2023
Solved

Replace parts of text that meets certain criteria in a text file

I have a text file with approx 58000 lines. The lines holds different types of content for different purposes. Some numbers that meets certain criterias should change to always have a fixed number o...
  • Lorenzo's avatar
    Lorenzo
    Jun 22, 2023

    Hi Hans_Olsson 

     

    Thanks for the pictures. According to the few examples you posted earlier #OBJEKT strings appear to be formatted as below but with copy/paste on the Web we're never sure so please check this first with your actual data

    The attached update highly/only relies on those consistent patterns (seems very consistent on your side according to your pictures :))

     

    #OBJEKT<2 spaces>6<2 spaces>"2003"<1 space>"Kastrup 11.1"
    #OBJEKT<2 spaces>25<1 space>"001"<1 space>"ŽTA 001"

     

Resources