Ciao a tutti, vorrei ottenere lo stesso risultato di
grep -Ev '(^[[:blank:]]*$|^#)'
Ho pensato a questo:
p = re.compile('^\s*$|^#.*', re.MULTILINE)
\s
Matches any whitespace character; this is equivalent to the class [
\t\n\r\f\v].
Se provo perĂ² a sostituire le righe che
Il giorno mer 1 feb 2023 alle ore 10:25 Valerio Pachera
ha scritto:
> Ciao a tutti, vorrei ottenere lo stesso risultato di
>
> grep -Ev '(^[[:blank:]]*$|^#)'
>
Per ora ho usato questo approccio:
with open('file.txt') as f:
p = re.compile('^\s*$|^#.*')
clean = [line for line in
On 01.02.2023 11:23, Valerio Pachera wrote:
Il giorno mer 1 feb 2023 alle ore 10:25 Valerio Pachera
ha scritto:
Ciao a tutti, vorrei ottenere lo stesso risultato di
grep -Ev '(^[[:blank:]]*$|^#)'
Per ora ho usato questo approccio:
with open('file.txt') as f:
p =