I'm using this sed command to delete the word --More-- :sed 's/--More--\s*/ /' tabladetallada.datthe original file looks like this:Device ID: BIOTERIO  IP address: 148.228.83.189Interface: GigabitEthernet1/0/6,  Port ID (outgoing port): GigabitEthernet0/1 --More--         Device ID: N7K-LAN(JAF1651ANDL)  IP address: 148.228.4.192Interface: GigabitEthernet1/0/1,  Port ID (outgoing port): Ethernet7/23Device ID: LAB_PESADO  IP address: 148.228.131.130Interface: GigabitEthernet1/0/11,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.131.130Device ID: Arquitectura_Salones  IP address: 148.228.135.61Interface: GigabitEthernet1/0/9,  Port ID (outgoing port): GigabitEthernet0/49  IP address: 148.228.135.61Device ID: CIVIL_253  IP address: 148.228.132.253 --More--         Interface: GigabitEthernet1/0/4,  Port ID (outgoing port): GigabitEthernet1/0/52  IP address: 148.228.132.253Device ID: Arquitectura  IP address: 148.228.134.253Interface: GigabitEthernet1/0/3,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.134.253Device ID: ING_CIVIL  IP address: 148.228.133.251Interface: GigabitEthernet1/0/7,  Port ID (outgoing port): GigabitEthernet0/2  IP address: 148.228.133.251Device ID: ING_CIVIL_DIR  IP address: 148.228.4.188Interface: GigabitEthernet1/0/10,  Port ID (outgoing port): GigabitEthernet0/2Device ID: Ingenieria_Posgrado  IP address: 148.228.137.253Interface: GigabitEthernet1/0/8,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.137.253Device ID: Biblio_Barragan  IP address: 148.228.136.61Interface: GigabitEthernet1/0/2,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.136.61Device ID: Electronica_Edif_3 --More--           IP address: 148.228.130.253Interface: GigabitEthernet1/0/5,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.130.253Once the word is deleted the white spaces after it are still thereHow can I delete them?Device ID: BIOTERIO  IP address: 148.228.83.189Interface: GigabitEthernet1/0/6,  Port ID (outgoing port): GigabitEthernet0/1           Device ID: N7K-LAN(JAF1651ANDL)  IP address: 148.228.4.192Interface: GigabitEthernet1/0/1,  Port ID (outgoing port): Ethernet7/23Device ID: LAB_PESADO  IP address: 148.228.131.130Interface: GigabitEthernet1/0/11,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.131.130Device ID: Arquitectura_Salones  IP address: 148.228.135.61Interface: GigabitEthernet1/0/9,  Port ID (outgoing port): GigabitEthernet0/49  IP address: 148.228.135.61Device ID: CIVIL_253  IP address: 148.228.132.253           Interface: GigabitEthernet1/0/4,  Port ID (outgoing port): GigabitEthernet1/0/52  IP address: 148.228.132.253Device ID: Arquitectura  IP address: 148.228.134.253Interface: GigabitEthernet1/0/3,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.134.253Device ID: ING_CIVIL  IP address: 148.228.133.251Interface: GigabitEthernet1/0/7,  Port ID (outgoing port): GigabitEthernet0/2  IP address: 148.228.133.251Device ID: ING_CIVIL_DIR  IP address: 148.228.4.188Interface: GigabitEthernet1/0/10,  Port ID (outgoing port): GigabitEthernet0/2Device ID: Ingenieria_Posgrado  IP address: 148.228.137.253Interface: GigabitEthernet1/0/8,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.137.253Device ID: Biblio_Barragan  IP address: 148.228.136.61Interface: GigabitEthernet1/0/2,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.136.61Device ID: Electronica_Edif_3             IP address: 148.228.130.253Interface: GigabitEthernet1/0/5,  Port ID (outgoing port): GigabitEthernet0/1  IP address: 148.228.130.253
Delete white spaces after certain character
awk;sed;grep;perl
The substitution should look likes/--More-- */ /ors/--More--[[:blank:]]*/ /sed does not know about \s for space but treats it as a literal s.* (space + *) will match zero or more spaces.[[:blank:]]* will match zero or more spaces or tabs.