Hi, given a sentence (from clipboard), how can I format it to have new layout as in the example?
I suppose the coma (,) may be part of the solution.
Original:
Biologia II - $500, Física y Química II - $500, Historia II - $1090, Carlomagno. El padre de Europa - $984, para Santiago Soler de 2do. Año.
Output (needed):
Biologia II - $500,
Física y Química II - $500,
Historia II - $1090,
Carlomagno. El padre de Europa - $984,
para Santiago Soler de 2do. Año.
It worked Perfect, thank you. It helps me a lot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
One more help please, How can I Sum al the values with the $
Biologia II - $500,
Física y Química II - $500,
Historia II - $1090,
Carlomagno. El padre de Europa - $984,
Something like this would work. Replace the clipboard variable with {clipboard} when you actually use it.
{clipboard="Biologia II - $500, Física y Química II - $500, Historia II - $1090, Carlomagno. El padre de Europa - $984, para Santiago Soler de 2do. Año."}
{=sum(filter(splitregex(clipboard, "\$(\d+)"), (x, i) -> isEven(i)))}
THANK YOU! It works as expected!!!
Question: Which is the command that tells the snippet to exclude the rest of the content of the data? How does it know to use only numbers? What happens if the content is "$500.45alabama" and not "$500.45 alabama", Does work with decimals?
Example
Biologia II - $500**, Física y Química II -** $500**, Historia II -** $1090**, Carlomagno. El padre de Europa -** $984**, para Santiago Soler de 2do. Año."**
Best regards!!!!!
You can support decimal numbers by changing the regular expression in splitregex() to this:
{clipboard="Biologia II - $500.21, Física y Química II - $500.3, Historia II - $1090, Carlomagno. El padre de Europa - $984, para Santiago Soler de 2do. Año."}
{=sum(filter(splitregex(clipboard, "\$(\d+\.?\d*)"), (x, i) -> isEven(i)))}
The "\d" tells it to match numbers so it won't match the "a" in "alabama" or other letters or things like spaces.