Q: Bash: How to delete characters from line There is a table with data.
./result_4_0.txt
./result_4_45.txt
./result_4_45.txt
./result_4_0.txt

I want to create two columns from numbers. How can I replace "./result_"  "_"  ".txt" just with space.
I tried before sed but it does not work together with dot or slash.
file="filename.txt"
while IFS= read line

do

done <"$file"


A: sed perfectly works with dots and slashes. You just need to escape those:
sed 's/\(\.\/result_\|_\)/ /g' filename.txt

Or, if you want more readability, something like that will also do:
sed 's=\./result_= =;s=_= =' filename.txt


A: $ tr -dc "\n0-9_" < input | awk -F_ '{print $2,$3}'
4 0
4 45
4 45
4 0

