Hi
In the process of learning REGEX and would be grateful if someone can please tell me how I can parse the following line into 7 different columns from one filed please?
01-OCT-21 ABCDE F/GHIJK LMNO 10,999 123.89 0.00 0.00 456.89
These are the column values:
01-OCT-21
ABCDE F/GHIJK LMNO
10,999
123.89
0.00
0.00
456.89
456.89
Thanks
Solved! Go to Solution.
Hi @lavorarchi
There are definitely different ways to approach this. But here is one way to parse it out:
(\d*-\w*-\d*)(\D*)(\d+.\d+)\s*(\d+.\d+)\s*(\d+.\d+)\s*(\d+.\d+)\s*(\d+.\d+)\s*
Pedro.
Thank you very much!
Hi @lavorarchi ,
For this, we can use the following expression.
([^\s]+)\s([^\d]+)\s([^\s]+)\s([^\s]+)\s([^\s]+)\s([^\s]+)\s([^\s]+)
([^\s]+) = everything but a space multiple times
([^\d]+) = everything but a digit
Best,
Fernando Vizcaino
Thank you appreciate it.
did you know that: \D the is
([^\d]+) = everything but a digit
(\D+)
cheers,
mark
@pedrodrfaria This has worked perfectly. I have some lines of data where the number is absolute and with some lines numbers are with decimals. (\d+.\d+) seems to work with where there are decimals - what is the expression to include anything which is 1-0 ie numbers with or without decimals?