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
6168 7 1-
- grayOlorin
- Member
- 1807 posts
- Joined: Oct. 2010
- Offline
-
- animatrix_
- Member
- 5100 posts
- Joined: Feb. 2012
- Offline
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] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- jlait
- Staff
- 6793 posts
- Joined: July 2005
- Offline
-
- grayOlorin
- Member
- 1807 posts
- Joined: Oct. 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!
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!
-G
-
- jlait
- Staff
- 6793 posts
- Joined: July 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
- 1807 posts
- Joined: Oct. 2010
- Offline
-
- mark
- Staff
- 2675 posts
- Joined: July 2005
- Offline
-
- mandrake0
- Member
- 655 posts
- Joined: June 2006
- Offline
-
- Quick Links

