Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
awk '
{
line=[blue]$0[/blue]
output=[red]"[/red][purple][/purple][red]"[/red]
[gray]# for every float on the line[/gray]
[olive]while[/olive] ([b]match[/b](line,[green]/[0-9]+[.]?[0-9]*/[/green])) {
[gray]# extract the float from the line[/gray]
number=[b]substr[/b](line,[blue]RSTART[/blue],[blue]RLENGTH[/blue])
[gray]# insert it into the output line[/gray]
output=output [b]substr[/b](line,1,[blue]RSTART[/blue]-1) [b]int[/b](number+0.5)
[gray]# save the rest of the line for further processing[/gray]
line=[b]substr[/b](line,[blue]RSTART[/blue]+[blue]RLENGTH[/blue])
}
output=output line
[b]print[/b] output
}
' input.svg > output.svg
#!/bin/bash
zenity --info --text "With this tool, you can convert the float number in a SVG file in a integer numbers. This will important reduce the size of the file.The convertetd file will save in the same directory like this script."
input=`zenity --title="Select a file" --file-selection --text="name of the file"`
awk '{
line=$0
output=""
# for every float on the line
while (match(line,/[0-9]+[.]?[0-9]*/)) {
# extract the float from the line
number=substr(line,RSTART,RLENGTH)
# insert it into the output line
output=output substr(line,1,RSTART-1) int(number+0.5)
# save the rest of the line for further processing
line=substr(line,RSTART+RLENGTH)
}
output=output line
print output
}
' "$input" > output.svg
zenity --info --text 'finished '