±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 509  |  »Ø¸´: 6
¡¾½±Àø¡¿ ±¾Ìû±»ÆÀ¼Û2´Î£¬×÷ÕßfspdlhÔö¼Ó½ð±Ò 2 ¸ö
µ±Ç°Ö÷ÌâÒѾ­´æµµ¡£
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

fspdlh

½ð³æ (ÕýʽдÊÖ)


[×ÊÔ´] ¡¾Ô­´´¡¿Ò»¸ö×Ô±àµÄ¶ÁÈ¡Îı¾ÎļþÊý¾ÝµÄº¯Êý

ÈçÌ⣬×Ô±àÁËÒ»¸öº¯Êý£¬×ÔÒѸоõÓÃÆðÀ´»¹ÊǺܷ½±ãµÄ£¬ÈçÓÐÐèÒª¿ÉÒÔÏÂÔØ¡£
    ¿ÉÒÔ¶ÁÈ¡Õû¸öÎļþ£¬¶ÁÈ¡µÚNÐУ¬¶ÁÈ¡µÚMÐе½µÚNÐУ¬¶ÁÈ¡µÚMÐе½µ¹ÊýµÚNÐУ¬¶ÁÈ¡µÚM´Î£¨Ò²¿ÉÒÔÊÇ×îºóÒ»´Î¡¢µ¹ÊýµÚM´Î£©³öÏÖ×Ö·û´®strµÄÐпªÊ¼£¨»ò½áÊø£©µÄÊý¾Ý£¬µÈµÈ¡£
ÒÔÏÂÊÇ×Ô±àµÄ°ïÖúÎĵµ¡£
%Get text from file
%
%Input paraments:
%   fid:        filename or the indicater of the file
%   sea_tag:    find the target text from the beginningning of the text or
%               the current position
%       0:  the beginningning of the file   
%       1:  the current position
%   beg profix: paraments to point out the beginning of the output text
%   end profix: paraments to point out the endding of the output text
%   tag:        target string, a string inclued in the target line
%   mode:       the method to match the target line
%       1:  comletely matched
%       2:  beginning matched including blanks
%       3:  beginning matched ignoring blanks
%       4:  included
%   count:      the Nth of the target line
%   offset:     offset from the target line
%       negative ingeger: Nth line before from the target line
%       zero:   the target line
%       positive integer: Nth line followed from the target line
%
%The number of input paraments:
% 1     y=GetFileText(  fid )
% 2     y=GetFileText(  fid,    offset )
% 3     y=GetFileText(  fid,    sea_tag,    offset )
% 4     y=GetFileText(  fid,    sea_tag,    beg_offset, end_offset  )
% 6     y=GetLineText(  fid,    beg_sea_tag,   
%                       beg_str,beg_mode,   beg_count,  beg_offset  )
% 7     y=GetFileText(  fid,    beg_sea_tag,    beg_offset,
%                       end_str,    end_mode,   end_count,  end_offset  )
% 7     y=GetFileText(  fid,    beg_sea_tag,
%                       beg_str,    beg_mode,   beg_count,  beg_offset,
%                       end_offset  )
% 10    y=GetFileText(  fid,    beg_sea_tag,   
%                       beg_str,    beg_mode,   beg_count,  beg_offset,
%                       end_str,    end_mode,   end_count,  end_offset  )

[ Last edited by sunxiao on 2009-3-8 at 13:11 ]
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

woshilsh

ÈÙÓþ°æÖ÷ (Ö°Òµ×÷¼Ò)


¡ï¡ï¡ï¡ï¡ï ÎåÐǼ¶,ÓÅÐãÍÆ¼ö

¹ÄÀø£¡ºÇºÇ£¡¼ÓÓÍ£¡¶à·¢²¼ÓÅÐã×ÊÔ´
4Â¥2009-03-03 09:15:06
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 7 ¸ö»Ø´ð

fspdlh

½ð³æ (ÕýʽдÊÖ)


¶ÁÈ¡ÎļþµÄÀý×Ó

>> type a.txt

01
02
03  01
04
05
06  01
07
08 01
09
10

>> GetFileText('a.txt')

ans =

    '01'
    '02'
    '03  01'
    '04'
    '05'
    '06  01'
    '07'
    '08 01'
    '09'
    '10'

>> GetFileText('a.txt',4)

ans =

04

>> GetFileText('a.txt',0,4,-2)

ans =

    '04'
    '05'
    '06  01'
    '07'
    '08 01'
    '09'

>> GetFileText('a.txt',0,'01',4,1,0)

ans =

01

>> GetFileText('a.txt',0,'01',4,2,0)

ans =

03  01

>> GetFileText('a.txt',0,'01',4,2,-1)

ans =

02

>> GetFileText('a.txt',0,'01',4,2,1)

ans =

04

>> GetFileText('a.txt',0,'01',4,-1,-2)

ans =

06  01

>> GetFileText('a.txt',0,'01',4,-2,0)

ans =

06  01

>> GetFileText('a.txt',0,'01',4,-2,0,-1)

ans =

    '06  01'
    '07'
    '08 01'
    '09'
    '10'

>> GetFileText('a.txt',0,'01',4,1,0,'01',4,-1,0)

ans =

    '01'
    '02'
    '03  01'
    '04'
    '05'
    '06  01'
    '07'
    '08 01'

>> GetFileText('a.txt',0,3,'01',4,3,0)

ans =

    '03  01'
    '04'
    '05'
    '06  01'
    '07'
    '08 01'
2Â¥2009-03-02 22:43:40
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

fox-fox

ľ³æ (ÖªÃû×÷¼Ò)


ÏÂÔØ£¬ÊÔÒ»ÏÂ
3Â¥2009-03-03 08:55:18
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

physics206

гæ (СÓÐÃûÆø)


ºÜ²»´í£¡Ð»Ð»Â¥Ö÷·ÖÏí
7Â¥2009-04-02 23:47:41
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
¡î ÎÞÐǼ¶ ¡ï Ò»ÐǼ¶ ¡ï¡ï¡ï ÈýÐǼ¶ ¡ï¡ï¡ï¡ï¡ï ÎåÐǼ¶
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] Çóµ÷¼Á +6 ÕÅ.1 2026-04-05 6/300 2026-04-05 16:30 by imissbao
[¿¼ÑÐ] 22408 ×Ü·Ö320£¬Ò»ÆªÂÛÎĶþ×÷£¬Á½¸ö¹úÈý£¬Çóµ÷¼Á +3 Leomulufu 2026-04-04 4/200 2026-04-05 15:52 by Leomulufu
[¿¼ÑÐ] ²ÄÁÏר˶322·Ö +8 ¹þ¹þ¹þºðºðºð¹þ 2026-04-04 8/400 2026-04-05 14:13 by brian0809
[¿¼ÑÐ] Ò»Ö¾Ô¸ÄϺ½£¬ÊýһӢһѧ˶317Çóµ÷¼Á£¡£¡ +5 Acaciad 2026-04-04 5/250 2026-04-05 12:31 by ²«»÷518
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +9 ¸ï΢¹ð 2026-04-04 9/450 2026-04-05 08:27 by 544594351
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +15 Ò»ÑùYWY 2026-04-01 15/750 2026-04-04 22:23 by hemengdong
[¿¼ÑÐ] 340Çóµ÷¼Á +4 jhx777 2026-03-29 4/200 2026-04-04 20:08 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] Ò»Ö¾Ô¸ÎäÀí²ÄÁϹ¤³Ì302µ÷¼Á»·»¯»ò»¯¹¤ +19 Doleres 2026-03-31 20/1000 2026-04-04 16:44 by °¡¿¡£¡
[¿¼ÑÐ] ±¾¿Æ211£¬×¨Òµ085404£¬293·ÖÇëÇóµ÷¼Á +5 Á«²Ë¾ÍÊÇź°É 2026-04-04 5/250 2026-04-04 14:08 by ÕâÊÇÒ»¸öÎÞÁĵÄê
[¿¼ÑÐ] µ÷¼Á +5 asdasdassda 2026-04-03 6/300 2026-04-03 20:27 by °¶ÉϵÄÒ»ÌõÓã
[¿¼ÑÐ] 285Çóµ÷¼Á +5 AZMK 2026-04-03 8/400 2026-04-03 18:17 by AZMK
[¿¼ÑÐ] Çó²ÄÁϵ÷¼Á Ò»Ö¾Ô¸Äϲý´óѧ 328·Ö +5 yyy..... 2026-04-03 5/250 2026-04-03 13:46 by °ÙÁéͯ888
[¿¼ÑÐ] 312Çóµ÷¼Á +6 ССī123 2026-04-02 7/350 2026-04-03 07:32 by jsw79
[¿¼ÑÐ] 372·Ö²ÄÁÏÓ뻯¹¤£¨085600£©Ò»Ö¾Ô¸ºþÄÏ´óѧÇóµ÷¼Á +5 À¶¼ãƬ 2026-04-02 6/300 2026-04-02 21:37 by dongzh2009
[¿¼ÑÐ] 260Çóµ÷¼Á +6 ÖìÜÆÁÕ 2026-04-02 6/300 2026-04-02 20:27 by 6781022
[¿¼ÑÐ] 318Çóµ÷¼Á£¬¼ÆËã²ÄÁÏ·½Ïò +10 Îüß÷Óк¦óÏÃü 2026-04-01 11/550 2026-04-02 16:29 by oooqiao
[¿¼ÑÐ] 285Çóµ÷¼Á +14 AZMK 2026-04-02 14/700 2026-04-02 15:54 by ÉϾÅÌìÀ¿Ô£¨ºÃÔ
[¿¼ÑÐ] 322Çóµ÷¼Á +5 ìäÙÒXX 2026-03-31 6/300 2026-04-02 10:08 by Çóµ÷¼Ázz
[¿¼ÑÐ] 085410 Ò»Ö¾Ô¸211 22408·ÖÊý359Çóµ÷¼Á +3 123456789qw 2026-03-31 4/200 2026-04-02 00:06 by ÒåÎÄwang
[¿¼ÑÐ] ²ÄÁϵ÷¼Á +11 Ò»ÑùYWY 2026-03-31 11/550 2026-04-01 22:25 by zhouyuwinner
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û