Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
File manupulation

Subject: File manupulation

From: Sebastian Gatzka

Date: 18 Nov, 2008 14:53:01

Message: 1 of 2

Hello World.

I'm having an outputfile from OpenFOAM, which I want to manipulate.
Unfortuately the solver is writing an information inside the output file, which I want to delete:

0 316 0 0
Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
0.1 316 294.652 0.932442
Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
0.2 316 294.681 0.932536

For MATLAB knowing what to import the text "Selecting incompressible transport model Newtonian" hast to be deleted, so all columns with the needed numerical information is accessible to MATLAB.

Is there a way of doing this inside MATLAB?

Subject: File manupulation

From: David

Date: 18 Nov, 2008 16:18:02

Message: 2 of 2

"Sebastian Gatzka" <sebastian.gatzka.NOSPAM@stud.tu-darmstadt.de> wrote in message <gfuksd$1nr$1@fred.mathworks.com>...
> Hello World.
>
> I'm having an outputfile from OpenFOAM, which I want to manipulate.
> Unfortuately the solver is writing an information inside the output file, which I want to delete:
>
> 0 316 0 0
> Selecting incompressible transport model Newtonian
> Selecting incompressible transport model Newtonian
> 0.1 316 294.652 0.932442
> Selecting incompressible transport model Newtonian
> Selecting incompressible transport model Newtonian
> 0.2 316 294.681 0.932536
>
> For MATLAB knowing what to import the text "Selecting incompressible transport model Newtonian" hast to be deleted, so all columns with the needed numerical information is accessible to MATLAB.
>
> Is there a way of doing this inside MATLAB?

probably lots of them, as a minumum you can use fopen/fread to read and process the file line by line yourself. there are probably other ways, but in general for a non-standard format you are probably best off just reading it yourself and processing it step by step.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us