Scilab/C4/File-handling/Gujarati
From Script | Spoken-Tutorial
Revision as of 14:58, 4 December 2015 by Jyotisolanki (Talk | contribs)
Time | Narration |
00:01 | Scilab વાપરીને File Handling પરના આ સ્પોકન ટ્યુટોરિયલમાં તમારું સ્વાગત છે. |
00:06 | આ ટ્યુટોરીયલમાં આપણે શીખીશું. |
00:08 | આપેલ ફન્કશન સાથે ફાઈલ હેન્ડલિંગ: |
00:11 | write() ફન્કશન |
00:12 | read() ફન્કશન |
00:14 | mopen() |
00:15 | mclose(). |
00:16 | પ્રદશન માટે હું ઉપયોગ કરી રહી છું સંસ્થાપિત Scilab 5.3.3 વર્જનના સાથે Ubuntu Linux 12.04 ઓપરેટીંગ સીસ્ટમ |
00:26 | તમને Scilab નું સામાન્ય જ્ઞાન હોવું જોઈએ. |
00:29 | જો નથી તો સંબંધિત ટ્યુટોરિયલ્સ માટે અમારી વેબસાઇટ જુઓ. spoken hyphen tutorial dot org. |
00:36 | હવે આપણે સાઈલેબમાં અમુક functions જોશું જે ફાઈલ હેન્ડલિંગ માટે ઉપયોગી છે. |
00:41 | ફાઈલ હેન્ડલિંગ સમાવે છે- |
00:44 | write() ફન્કશન ને વાપરીને ફાઈલ લખતા , |
00:47 | read() ફન્કશન ને વાપરીને ફાઈલમાં થી વાંચતા. |
00:51 | mopen() ફન્કશન ને વાપરીને વર્તમાન ફાઈલ ખોલતા. |
00:55 | mclose() ફન્કશન ને વાપરીને ખુલેલી ફાઈલને બંદ કરતા. |
01:00 | ચાલો હવે ફાઈલ માટે ડેટા લખવાથી શરૂઆત કરીએ. |
01:03 | આ માટે write() કમાંડનો ઉપયોગ થાય છે. |
01:07 | સાઈલેબ કન્સોલ વિન્ડો પર જાઓ. |
01:10 | આના સાથે શરૂઆત કરવા માટે રેન્ડમ નંબરનું એક મેટ્રીક્સ બનાવીએ. |
01:15 | ટાઈપ કરો: random underscore matrix is equal to rand into bracket 20 comma 1 close the bracket semicolon અને એન્ટર દબાવો. |
01:29 | હવે વર્તમાન કાર્ય કરતી ડિરેક્ટરીને તપાસીએ. |
01:32 | ટાઈપ કરો pwd . |
01:34 | In my case, the present working directory is slash home slash fossee . |
01:39 | Make sure that you are in a directory where you have read & write permission, before you execute these commands. |
01:47 | Now we will write the content of variable random underscore matrix into a text file using the write command. |
01:55 | Type:--> write into bracket into quotes random dash numbers dot txt close the quotes comma random underscore matrix close the bracket and press Enter. |
02:18 | Let us see whether this file has been created. |
02:21 | I will minimize the Scilab console window. |
02:23 | And open the file which will be created and saved in the fossee directory of my computer. |
02:33 | You can see the data from variable random underscore matrix is written in a text file random dash numbers dot txt. |
02:42 | I will close this file. |
02:45 | Coming back to the Scilab console. |
02:47 | Now we will see how to read the data from a file. |
02:50 | For this we will use the command read as follows: |
02:55 | Type: new underscore vector is equal to read into bracket into quote random dash numbers dot txt close the quotes comma 20 comma 1 close the bracket and press Enter. |
03:18 | The read command reads all the data from the file mentioned in the argument, |
03:23 | in this case random dash numbers dot txt, |
03:27 | and stores in the variable new underscore vector. |
03:31 | Press Enter to continue the display. |
03:35 | If we modify the above command as: |
03:39 | new underscore vector is equal to read into bracket into quotes random dash numbers dot txt comma 19 comma 1 |
03:49 | The read command reads only 19 data values from the file mentioned in this argument, |
03:56 | in this case random dash numbers dot txt, |
03:59 | and stores in the variable new underscore vector. |
04:03 | Issue this command on the Scilab console and verify the output. |
04:08 | Now let us see about the mopen() function: |
04:12 | fd = mopen into bracket file-name comma mode |
04:17 | mopen command is used to open an existing file in a way compatible to C fopen procedure. |
04:25 | mode is a character string that controls whether the file is opened for: |
04:30 | r = opens the file for reading. |
04:34 | rb = opens a binary file for reading. |
04:39 | rt = opens a text file for reading. |
04:43 | w = creates a new file for writing or opens and truncates a file to zero length. |
04:50 | wb = creates a new binary file for writing or opens and truncates a file to zero length. |
04:58 | wt = creates a text binary file for writing or opens and truncates a file to zero length. |
05:06 | a or ab = appends (opens a file for writing at the end of the file or creates a file for writing). |
05:14 | r+ or r+b = opens a file for update (reading and writing). |
05:20 | For eg. fd underscore r is equal to mopen('random-numbers,'rt') |
05:30 | The above command opens the 'random-numbers' as a 'text and read-only' mode. |
05:37 | mclose into bracket fd: |
05:40 | closes the opened file by using mopen |
05:43 | where fd is the file descriptor of the opened file. |
05:48 | If fd is omitted, mclose() closes the last opened file. |
05:53 | That's all we have in this tutorial. |
05:55 | We have learnt - |
05:56 | File handling with the following functions: |
05:59 | write() function |
06:00 | read() function |
06:02 | mopen() |
06:03 | mclose(). |
06:05 | Watch the video available at the following link. |
06:08 | It summarizes the Spoken Tutorial project. |
06:11 | If you do not have good bandwidth, you can download and watch it. |
06:14 | The spoken tutorial Team: |
06:17 | Conducts workshops using spoken tutorials |
06:20 | Gives certificates to those who pass an online test. |
06:23 | For more details, please write to conatct@spoken-tutorial.org. |
06:30 | Spoken Tutorial Project is a part of the Talk to a Teacher project. |
06:34 | It is supported by the National Mission on Eduction through ICT, MHRD, Government of India. |
06:41 | More information on this mission is available at http://spoken-tutorial.org/NMEICT-Intro. |
06:50 | This is Anuradha Amrutkar from IIT Bombay, signing off. |
06:54 | Thank you for joining. |