Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for comma-separated numbers? #319

Open
saurabhnanda opened this issue Apr 5, 2019 · 2 comments
Open

Support for comma-separated numbers? #319

saurabhnanda opened this issue Apr 5, 2019 · 2 comments

Comments

@saurabhnanda
Copy link

Is there any way to parse 1,234,567 as a number?

Use-case: I'm trying to parse the output of rsync --stats, which looks like the following:

Number of files: 2,954,826 (reg: 1,178,981, dir: 1,775,845)
Number of created files: 29 (reg: 16, dir: 13)
Number of deleted files: 0
Number of regular files transferred: 25
Total file size: 138,567,893,245 bytes
Total transferred file size: 21,814,234 bytes
Literal data: 3,923,368 bytes
Matched data: 17,890,866 bytes
File list size: 10,947,374
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 1,865,173
Total bytes received: 111,947,536

sent 1,865,173 bytes  received 111,947,536 bytes  1,089,116.83 bytes/sec
total size is 138,567,893,245  speedup is 1,217.51
@kyparisisg
Copy link

kyparisisg commented Dec 10, 2019

Hello @saurabhnanda,

I am not sure if that helps but you can probably read the whole number by simply using this %field_name:word% (One or more characters, up to the next space (\x20), or up to end of line.). For more complicated situations, keep in mind that you can also use:
%field_name:char-sep:\x20% OR %field_name:char-to:\x20%
(\x20 is hex and represents whitespace, it can be replaced with other punctuation characters, decimal point, etc )

Let me know if that helps.

@davidelang
Copy link
Contributor

davidelang commented Dec 12, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants