package com.hecate.randomstuff ; import java.nio.file . Files ; import java.nio.file . Path ; import java.nio.file . Paths ; import java.util . List ; public class TwoZeroSevenZeroTwo { synchronized void parseData ( ) throws Exception { Path upgradeFile = Paths . get ( "C:/MrKirill1232/content_data.txt" ) ; if ( ! Files . exists ( upgradeFile ) ) { System . err . println ( "File not found - " + upgradeFile ) ; } List fileContent = Files . readAllLines ( upgradeFile ) ; StringBuilder out = new StringBuilder ( ) ; for ( String content : fileContent ) { List splitContent = List . of ( content . split ( ":" ) ) ; int status = 0 ; for ( String str : splitContent ) { if ( str . isEmpty ( ) || str . contains ( "https" ) || str . contains ( "//www." ) || str . isBlank ( ) ) { continue ; } out . append ( str . replace ( " " , "" ) ) ; status ++ ; if ( status == 1 ) { out . append ( ":" ) ; } } out . append ( "\n" ) ; } Files . writeString ( Paths . get ( "C:/MrKirill1232/OutputData.txt" ) , out . toString ( ) ) ; } public TwoZeroSevenZeroTwo ( ) { } public static void main ( String [ ] args ) { try { new TwoZeroSevenZeroTwo ( ) . parseData ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } }