Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trimming text files from command line (Windows)

I have a text file which contains several hundred lines e.g.

test.bin:8948549854958

They are all styled like the above file (xxxxxxx.xxx:xxxxxxxxxxxxxx)

Is there any way I could trim all lines e.g. take :xxxxxxxxxxxxxxx of the line, so just to leave xxxxxxx.xxx ?

like image 649
Mike Avatar asked Dec 28 '22 21:12

Mike


1 Answers

Trim.bat:

@FOR /F "tokens=1 delims=:" %%G IN (%1) DO @echo %%G

Usage: trim source.txt > destination.txt

See here.

like image 97
margnus1 Avatar answered Jan 06 '23 02:01

margnus1