Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語

Please note that the recommended version of Scilab is 6.0.1. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Files : Input/Output functions > mputl

mputl

writes strings in an ascii file

Calling Sequence

r = mputl(txt ,file_desc)

Arguments

r

returns %t or %f to check if function has correctly written on the file.

file_desc

A character string giving the name of the file or a logical unit returned by mopen.

txt

a vector of strings.

Description

mputl function allows to write a vector of strings as a sequence of lines in an ascii file.

Examples

fd = mopen(TMPDIR+'/text_mputl.txt','wt');
mputl('Hello World',fd);
mclose(fd);

fd = mopen(TMPDIR+'/text_mputl.txt','rt');
disp(mgetl(fd));
mclose(fd);

See Also

  • mget — reads byte or word in a given binary format and convert to double
  • mgetl — read lines from an text file
  • mclose — close an opened file
  • mfprintf — converts, formats, and writes data to a file
  • mput — writes byte or word in a given binary format
  • mputstr — write a character string in a file
  • mopen — open a file
  • write — write in a formatted file

Authors

S. Steer

Allan CORNET

Comments

Author : posted the 09/02/2011 11:45
This is an example of a calling sequence with the filename as input argument.

content = [
"1 2 3 4"
];
filename = fullfile(TMPDIR,"data.txt");
mputl(content,filename);

By the way, the examples should not use the "/" as the delimitor, which is confusing (even if the example works perfectly on Windows).

fd = mopen(fullfile(TMPDIR,'text_mputl.txt'),'wt');
mputl('Hello World',fd);
mclose(fd);

Reply to this comment
Please login to comment this page


Add a comment:
Please login to comment this page.

<< mput Files : Input/Output functions mputstr >>

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 12 11:44:25 CEST 2011