Hi again Amir
OK thats a bit more complicated but still not too bad. You will need to write your own text parser in Python but there will be plenty of examples of that on the web.
As for the Maya side, I've changed the previous script so that it now doesn't bother with the turbulence field and instead loops over the entire fluid container and sets each vector to be (0, 1, 0). You will simply need to add your code to replace that vector with the correct one from your text file:
import maya.mel as mel
import maya.cmds as cmds;
# Create a fluid container
fluid = mel.eval("create3DFluid 20 20 20 10 10 10")
# Enable velocity draw on the fluid container
cmds.setAttr((fluid+".velocityDraw"), 1)
# Get the resolution (Even though we specified it above)
res = cmds.getAttr(fluid + ".res");
# Nested loops to cycle over each voxel
for z in range(0, int(res[0][2])):
for y in range(0, int(res[0][1])):
for x in range(0, int(res[0][0])):
# This command sets the velocity value on the selected fluid container.
# You will need some file reading code to replace the vv=(0,1,0) and set
# it to your vector value
cmds.setFluidAttr(at="velocity", vv=(0,1,0), xi=x, yi=y, zi=z)