• ベストアンサー
※ ChatGPTを利用し、要約された質問です(原文:Perlについて教えてください!)

Perlについて教えてください!

salsberryの回答

  • ベストアンサー
  • salsberry
  • ベストアンサー率69% (495/711)
回答No.3

1行1文ならばとりあえずどうやって文単位で分割するかは考えないで済みます。 一番簡単なのは、入力ファイルを2回読むことです。1回目は全部で何行(何文)あるかを数えるだけ、その結果を使って先頭から10%と末尾から10%にあたる行(文)を別のファイルに書き出すのが2回目。 入力ファイルを1回しか読んではいけないという条件がつくと少々面倒になりますし、先頭から10%の出力を行うのに必要なメモリ量が膨れあがります。

関連するQ&A

  • VOA OBAMA

    Sitting with the Chinese leader in Honolulu, Mr. Obama called cooperation with China vital, adding that despite differences, they would discuss how to re-balance growth and ensure there is a "win-win" trading relationship. (1)辞書を引くと call for cooperation withで~の協力を要請する とありますが、forが抜けてるのでしょうか? (2)China vital とは何でしょうか? よろしくお願いします。

  • 日本語に訳してください

    文が途中からなんですがお願いします(´>ω<`) It was one of the mort moving experience I've ever had. After the concert,I joined his taiko workshop. Mr. Hayashi and I talked a lot. He was born in Hiroshima in 1952. From 1971 to 1981,he played the taiko as a member of a group. In 1982,he started to perform as soloist. Mr. Hayashi created an original way of playing the taiko. With his unique combination of taiko drums,he can make a rich sound even when plays by himself, In 1948,he made his debut at Carnegie Hall. That was the first taiko soloist performance seen there. Since then he has performed around the world. Now I'm learning how to play the taiko with a taiko group in Dublin. Mr. Hayashi instructed us when he was here. I want to learn the taiko in Japan someday .

  • 和訳をよろしくお願いします

    Furthermore, in August 2009, Mr. So-and-so began a campaign against a McDonald’s Japan advertisement featuring a burger mascot named Mr. James. His grievance was that Mr. James perpetuates negative stereotypes about non-Japanese Caucasian minorities living in Japan.

  • 和訳をお願いします。

    The Afghanistan decision was a big deal; if it went wrong, we were cooked on national security. It didn't. Mr. Obama's decision to support Gen. Stanley McCrystal's counterinsurgency plan in Afghanistan was a procedural mess but arrived at the right result. この文章の中の次の部分の意味が分かりません。 「we were cooked on national security」 どなたか教えて頂けませんか。

  • 日本語に訳してください!

    John Watson was having another nightmare. It was always the same - guns firing , bombs exploding and army officers shouting orders to their men. As usual , the terrible feeling that any moment might be his last. Jhon woke up , breathing hard , and stared into the darkness of his small flat. His mind took several long seconds to realise that he was no longer in Afghanistan - his days in the army were over now.

  • このwho wasが省略できない理由は?

    A soldier who was almost killed in Afghanistan is vowing to return to Army service despite his serious injuries. を、 A soldier almost killed in Afghanistan is vowing to return to Army service despite his serious injuries. と、しては、いけないようです。 何故なのでしょうか? よろしくお願い致します。

  • これらの文を訳して欲しいです!!

    これらの文を訳して欲しいです!! The trouble is that with all this knouledge a child does not know what to do, how to make decision. He was liberal in his way of thinking,but his argument is far from that supported by lobbyist. At the boarding school I went to,the school dining hall was called Merry House.Whoever gave it that name obviously had a strange sense of humor; it was not merry at all for the people who had to eat there every day. All roads to the coastal area were blocked by the biggest storm in ten years. Who's coming with me to pick up the groceries that we ordered earlier? The traditional roles for Japanese men and women are no longer suitable for many people and need to be changed.

  • 英文解釈(高校1年)教えてください

    Einstein's pacifism was something he did little to hide.He spoke and wrote extensively against the way militaristic governments dealt with the problem of war,and condemned these governments for saying they were protecting their countries.Einstein argued that "you cannot simultaneously prevent and prepare for war.The prevention of war requires more faith,courage and resolution than is needed to prepare for war." The contributions Einstein ( 1 ) in the field of science are undeniable.In a century dominated by science,he was the dominant scientist.His discoveries and theories created a movement away from passive experimentation into a more profound method of thinking.This led to (2)[his theory of relativity];that the world was not as it seemed.Yet ( 3 ) all the advances in modern thinking that were brought on by Einstein,one thought remains true;science was Einstein's work,but pacifism was his life. 上の英文の(2)[his theory of relativeity]を生むきっかけとなった当時の科学界の動向はどんなものだったか。日本語で簡潔に答えよ。 という問題です。 その前にある from passive experimentation into a more profound method of thinking の passive experimentation の部分がそれに相当するのかなと思いますが、この前後の文章の意味するところが辞書で調べてもいまいちつかめず、どのようなことばで表現すれば適当なのかわかりません。 解説よろしくお願いします。

  • 英語 和訳

    (1)He hold Truman that with nuclear weapons he could not only quickly end the war in Korea,but also "strike a blocking blow to international communism." (2)His idea of making the Korean War into a world war against communism was not popular in Washington. どなたかこの2つの英文の和訳をよろしくお願いします。

  • by the tight nature訳と働き

    By choosing to spend several million dollars each on commercials that will run simultaneously in more than a dozen states over the next 10 days -- and, in Mr. Obama’s case, on CNN and MSNBC as well -- Mr. Obama and Mrs. Clinton are being driven by the tight nature of the race thus far and by the bunching of Democratic nominating contests in 22 states on Feb. 5. >Mr. Obama and Mrs. Clinton are being driven by the tight nature of the race thus far オバマ氏、クリントン氏はこれまでのところびっしりと組まれた選挙日程に追い立てられている。 natureの働きを教えてください。