Hey guys, I think I may have actually asked this on a now locked and invisible thread so I thought I would ask it again, especially with all the cool new string operations in H14 vex:
what is the best way to operate on lines on a file in vex? I basically want to create a point for each line on a file based on some parameters in the line, i.e:
13.5 44.7 4.6 0 255 128 128
where the format is x y z i (intensity) r g b
thank you!
parsing files with VEX
4618 7 1- grayOlorin
- Member
- 1799 posts
- Joined: 10月 2010
- Offline
- animatrix_
- Member
- 4521 posts
- Joined: 2月 2012
- Online
You can use file_open and file_readlines:
http://www.sidefx.com/docs/houdini14.0/vex/functions/file_open [sidefx.com]
http://www.sidefx.com/docs/houdini14.0/vex/functions/file_readlines [sidefx.com]
http://www.sidefx.com/docs/houdini14.0/vex/functions/file_open [sidefx.com]
http://www.sidefx.com/docs/houdini14.0/vex/functions/file_readlines [sidefx.com]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- jlait
- スタッフ
- 6219 posts
- Joined: 7月 2005
- Offline
- grayOlorin
- Member
- 1799 posts
- Joined: 10月 2010
- Offline
He he he I was wondering why I did not see them on the new features section the other problem I have is that, ideally, I can parse multiple lines of the file at once in parallel via simd (the reason why I wanted to use vex) I presume I would have to put it in a string array attribute first? (Would it work with 100 mil lines?)
Thank you guys!
Thank you guys!
-G
- jlait
- スタッフ
- 6219 posts
- Joined: 7月 2005
- Offline
Currently you need to do a systemRAW() expression on a string field, then you can chs() into VEX.
You won't get SIMD processing then, however. It is hard to set that up currently without there being an O(n^2) component that will eliminate the advantage of SIMD actions…
I've done this with some large files, but I don't think 100 million.
You won't get SIMD processing then, however. It is hard to set that up currently without there being an O(n^2) component that will eliminate the advantage of SIMD actions…
I've done this with some large files, but I don't think 100 million.
- grayOlorin
- Member
- 1799 posts
- Joined: 10月 2010
- Offline
- mark
- スタッフ
- 2592 posts
- Joined: 7月 2005
- Offline
- mandrake0
- Member
- 637 posts
- Joined: 6月 2006
- Offline
-
- Quick Links