PERL/C3/File-Handling/Khasi

From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:01 Khublei ngi pdiangsngewbha iaphi sha ka Spoken Tutorial halor ka File Handling ha ka PERL.
00:06 Ha kane ka jinghikai, ngin ia pule kumno ban:

Plie ia ka file ha ka read mode Write sha ka file Plie ia ka file ha ka append mode Khang ia kafile handle.

00:17 Na ka bynta kane ka jinghikai, nga pyndonkam da ka:

Ubuntu Linux 12.04 operating system Perl 5.14.2 bad ka gedit Text Editor.

00:28 Phi lah ban pyndonkam da kano kano ka text editor katkum ka mon jong phi.
00:32 Ban bud ia kane ka jinghikai, phi dei ban don ia ka jingtip shaphang ka Perl programming.
00:37 Lada phim don, te leit sha ki spoken tutorials ha ka Perl ha ka spoken tutorial website.
00:43 Ki basic operations kiba ngi lah ban leh bad ki files ha ka Perl kidei:

Plie ia ka file read na ka file write sha ka file bad khang ia ka file.

00:54 Ki default file handles kidei:

STDIN STDOUT STDERR

01:02 Kane kadei ka syntax na ka bynta ka open function.
01:05 Ha ka syntax, FILEHANDLE kadei ka file handle ba la pynphai da ka open function.
01:11 Ka MODE ka mihkhmat ia ka mode kaba plie ia ka file. Kum ka nuksa: read, write, bad kiwei kiwei
01:18 EXPR kadei ka physical filename kaba lah pyndonkam ban read lane write. Ha ka liang jong ngi, “First.txt” kadei ka filename.
01:27 Kadon sa kawei pat ka lynti ban write ia kaopen function, kumba la pyni hangne.
01:32 To ngin ia pyrshang ban sngewthuh kumno ban plie ia ka file ba lah don lypa bad read ia ki data na ka.
01:38 Nyngkong ngin ia shna ia ka text file bad buh katto katne ki data ha ka. Leit sha ka terminal bad type: gedit first.txt bad shon Enter.
01:51 Ha ka first dot txt file, type ia ka text harum.
01:55 Save ia ka file bad khang ia ka gedit.
01:59 Mynta ngin ia peit ia ka Perl program kaba plie ia ka file 'first.txt' bad read ia ki content.
02:07 To ngan plie ia ka sample program 'openfile.pl' kaba nga lah dep save lypa.
02:13 Type: gedit openfile dot pl ampersand bad shon Enter.
02:19 Ha ka openfile dot pl file, type ia u code harum kumba lah pyni ha ka screen.
02:25 To mynta ngin ia pyrshang ban sngewthuh ia u code.
02:28 Ka open function ka plie ia ka file na ka bynta ban read.
02:33 U parameter ba nyngkong jong ka DATA udei u filehandle uba ailad ia ka Perl ban leit sha ka file hadien habud.
02:40 U parameter ba ar “<” less than symbol u pynithuh ia ka READ mode.
02:44 Lada phim lah ban kdew ia ka Mode, da kaba long hi ka file kan sa plie ha ka “READ” mode.
02:50 U parameter ba lai 'first.txt' udei u filename na kaba ka data kadei ban read
02:57 Kaei ka ban jia lada ka file 'first.txt' kam don?
03:02 Ka script kan sa iap ryngkat ka error message badei, kaba lah buh ha ka dollar exclamation ($!)variable.
03:08 Ka while loop kan read kawei pa kawei ka lain bad kan loop lyngba ka <DATA> file haduh ba baroh ki lain ki lah read lut.
03:17 Print dollar underscore ('$_') variable kan print ia ki contents jong ka lain ba mynta.
03:22 Khatduh eh, khang ia ka file da ka kyrteng jong ka FILEHANDLE kaba ngi lah ai ha ka open statement.
03:29 Ka jingkhang ia ka file ka iada na kano kano ka jingkylla ba jia khlem poi pyrkhat lane kaba write halor jong ka content
03:36 Mynta, shon Ctrl+S ban save ia ka file.
03:40 To ngin ia execute ia ka program.
03:42 Phai biang sha ka terminal bad type perl openfile dot pl bad shon Enter.
03:51 Ka output kadei kumba la pyni.
03:54 Kane kadei kajuh ka content kaba ngi lah iohi hashwa ha ka first dot txt file.
03:59 Hadien kane ngin sa iohi kumno ban write ia ka data ha ka file.
04:03 Ka open statement bad greater than (>) symbol ka batai ia ka WRITE mode.
04:08 Ka Filename ka pynithuh ia ka kyrteng jong ka file ha kaba dei ban write ia ka data.
04:13 To ngan plie ia ka sample program 'writefile.pl' kaba nga lah dep save lypa.
04:19 Phai sha ka terminal.
04:21 Mynta type: gedit writefile dot pl ampersand bad shon Enter.
04:29 Ha ka writefile dot pl file, type ia u code harum kumba lah pyni ha ka screen.
04:34 To mynta ngan batai ia u code.
04:37 Ka open function ka plie ia ka file 'second.txt' ha ka "write" mode.
04:44 “>” - Greater than symbol hashwa jong ka filename ka pynithuh ia ka "write" mode.
04:49 Ka parameter ba nyngkong "FILE1" kadei ka FILEHANDLE.
04:53 Ka print function ka print ia ka text ba lah ai sha ka FILEHANDLE. Kata 'FILE1'.
04:59 Mynta, shon Ctrl+S ban save ia ka file.
05:03 To ngin ia execute ia ka program.
05:05 Phai biang sha ka terminal bad type: perl writefile dot pl bad shon Enter.
05:12 Mynta to ngin ia check lada ia ka text lah write ne em ha ka 'second.txt' file.
05:18 Type: gedit second.txt bad shon Enter.
05:23 Ngi lah ban iohi ia ka text: "Working with files makes data storage and retrieval a simple task!" ha ka 'second.txt' file jong ngi.
05:32 To ngin ia khang ia ka 'second.txt' file.
05:35 Kaei ka ban jia lada ngi plie biang sa shisien ia kajuh ka file ha ka "write" mode? To ngin ia peit.
05:41 Ha ka 'writefile.pl', comment ka print statement ba hashwa.
05:46 Pyndap ia ka print command ba la ai harum.
05:48 Mynta, shon Ctrl+S ban save ia ka file. To ngin ia execute ia ka program.
05:54 Phai biang sha ka terminal bad type perl writefile dot pl bad shon Enter.
06:00 Mynta, to ngin ia check ia ka'second.txt' file sa shisien.
06:04 Type: "gedit second.txt" bad shon Enter.
06:09 Ngi lah ban iohi ia ka output: “Greater than symbol (>) overwrites the content of the file!"
06:14 Ki contents ba hashwa jong ka 'second.txt' file ki lah shah pyndam bad pyndap da kiwei.
06:19 Kane kadei na kadaw, ngi lah plie ia ka file ha ka "write" mode sa shisien.
06:24 To ngin ia khang ia ka 'second.txt' file.
06:27 Hadieng kane, ngin sa iohi kumno ban append ia ka data sha ka file ba lah don lypa.
06:32 Ka open statement ryngkat bad ar tylli ki greater than (>>) symbols ki pynithuh ia ka "APPEND" mode.
06:38 Mynta, ngan plie ia ka writefile dot pl sa shisien ha ka gedit.
06:44 Ha ka open statement, type ar tylli ki greater (>>) than symbols. Kane kan sa pynithuh ba ka file kadon ha ka append mode.
06:52 Comment ia ka print statement ba hashwa, namar ba ka lah dep execute lypa.
06:57 Pyndap ia ka line print FILE1 within double quotes "Two greater than symbols (>>) open the file in append mode", ban append ia ka data ba lah don lypa.
07:07 Mynta, shon Ctrl+S ban save ia ka file.
07:11 To ngin ia execute ia ka program.
07:14 Phai biang sha ka terminal bad type: perl writefile dot pl bad shon Enter.
07:20 Mynta, to ngin ia check lada ka text ka lah dep append ne em sha ka 'second.txt' file.
07:26 Type: gedit second.txt bad shon Enter.
07:31 Ngi lah ban iohi ia ka text ba ka lah dep append ha ka 'second.txt' file jong ngi.
07:36 To ngin ia khang ia ka 'second.txt' file.
07:39 Ha kajuh ka rukom, kidon shuh sa kiwei ki modes ruh.
07:42 Pyrshang hi dalade ia kine ki options bad sngewthuh kaei kaba jia.
07:49 Da kane ngi lah poi sha kaba kut jong kane ka jinghikai. To ngin ia batai kyllum.
07:53 Ha kane ka jinghikai, ngi lah pule kumno ban:

Plie ia ka file ha ka read mode Write sha ka file Plie ia ka file ha ka append mode Khang ia kafile handle.

08:03 Hangne ka kam na ka bynta jong phi. Pynkylla ia ka file attribute sha "+>" ha ka 'writefile.pl' program.
08:11 Save bad execute ia ka program.
08:14 Plie ia ka 'second.txt' file ban iohi ia ka output.
08:17 Peit thuh ia ka jingpyndonkam jong ka file attribute "+>".
08:22 Ka video ha ka link harum ka batai kyllum ia ka Spoken Tutorial project. Sngewbha download bad peit ia ka.
08:29 Ka kynhun jong ka Spoken Tutorial Project:

Ka pynlong ia ki workshops da kaba pyndonkam ia ki spoken tutorials bad Ka ai certificates sha kito kiba pass ha ka online tests.

08:37 Na ka bynta ki jingtip ba bniah, sngewbha thoh sha ngi.
08:41 Ia ka Spoken tutorial project la bei tyngka da ka NMEICT, MHRD, Sorkar India.
08:48 Kham bun ki jingtip halor kane ka mission kidon ha kane ka link.
08:53 Ma nga u Pdiangburom na shillong nga pynkut ia kane. Khublei shibun.

Contributors and Content Editors

Pdiangburom