-1

我需要删除或删除此文件的前 6 行(下面给出的是我的输入文件)并将其余的写入单独的文本文件中?我该怎么做....

[S:00]
{org:en}
I called the number and the lady told me she was talking on the phone to Toby Studabaker,'' Sherry Studabaker told BBC television.

{/org}
{unl}
agt(call(icl>do,equ>dial,plt>thing,plf>thing,agt>volitional_thing,rec>thing).@entry.@past,i(icl>person):01)
and(:01,call(icl>do,equ>dial,plt>thing,plf>thing,agt>volitional_thing,rec>thing).@entry.@past)
rec(call(icl>do,equ>dial,plt>thing,plf>thing,agt>volitional_thing,rec>thing).@entry.@past,number(icl>abstract_thing,icl>quantity,obj>thing).@def)
agt:01(tell(icl>say>do,cob>uw,agt>person,obj>uw,rec>person):01.@entry.@past,lady(icl>woman>person).@def)
rec:01(tell(icl>say>do,cob>uw,agt>person,obj>uw,rec>person):01.@entry.@past,i(icl>person):02)
agt:02(talk(icl>communicate>do,cob>uw,agt>person,obj>thing,ptn>person).@entry.@past.@progress,she(icl>person))
cob:02(talk(icl>communicate>do,cob>uw,agt>person,obj>thing,ptn>person).@entry.@past.@progress,phone(icl>electronic_equipment>thing,equ>telephone).@def)
ptn:02(talk(icl>communicate>do,cob>uw,agt>person,obj>thing,ptn>person).@entry.@past.@progress,toby)
nam:02(toby,studabaker:01)
agt:03(tell(icl>say>do,cob>uw,agt>person,obj>uw,rec>person):02.@past,sherry(icl>fortified_wine>thing).@maiuscul)
nam:03(sherry(icl>fortified_wine>thing).@maiuscul,studabaker:02)
rec:03(tell(icl>say>do,cob>uw,agt>person,obj>uw,rec>person):02.@past,bbc(iof>organization))
obj:03(tell(icl>say>do,cob>uw,agt>person,obj>uw,rec>person):02.@past,television(icl>broadcasting>thing))
and(tell(icl>say>do,cob>uw,agt>person,obj>uw,rec>person):02.@past,:02)
obj:01(tell(icl>say>do,cob>uw,agt>person,obj>uw,rec>person):01.@entry.@past,:03)
{/unl}
4

1 回答 1

1

你是怎样做的?

  open input file
  open output file
  repeat:
      read line
      is line number greater than 6?
         write line
  until EOF
  close files

现在用 Java 编写代码。


在 Java 中没有聪明的方法可以做到这一点,而且我不知道有任何 3rd 方库可以显着简化这个(已经非常简单)问题。

于 2013-10-31T09:29:31.370 回答