script for replacing block of code
Im runnning OpenFoam on a server. im exchanging the data with samba and do the post processing with paraview on windows the problem is that paraview doesn't know the bc:
Code:
inflow Code:
inflow I am looking for a script that is able to replace the whole String block with another one I just manage do replace a string with a script in the subfolder my code for that is (which works but doesn't solve the problem): Code:
#!/bin/bash Can anybody post a script that will replace the bc with the other one? |
In vim, you *can* do multiline find-replace. Just use '\n' to capture newlines.
There's probably a better way, as this gets messy. But you can try: Code:
:%s/inflow\n{\ntype uniformFixedValue; \nuniformValue table \n(\n( 0 (0 0 0.0))\n( 0.0005 (50 0 0.0)) \n( 0.0025(600 0 0)) \n);\n}/inflow\r{\rtype fixedValue;\rvalue uniform (600 0 0);\r} Anyways, I just tried this and it worked. |
im really bad at scripting. so i just replaced sed with vim.tiny followed by the long command:
Code:
#!/bin/bash Can vim be used in a script and is vim.tiny able to do that? vim isn't installed at the server. i sadly haven't worked with vim at all. |
All times are GMT -4. The time now is 17:46. |