-3

テキスト エディタで編集すると、大量の情報を表示する .mov ファイルがあります。情報を抽出して .txt ファイルを作成するプログラムを作成して、毎月新しい .mov ファイルを取得したときに実行できるようにしたいと考えています。

.mov ファイル内の情報は次のようになります...

[Categories]
1   hollywoodhd 1295    1295    Movies  1
2   mega    1095    1095    Movies  1
3   still   1095    1095    Movies  1
4   special 895 895 Movies  1
5   family  1095    1095    Movies  1

[Titles]
  hollywoodhd1 1 0 8046 0 919 PG-13 6712 1 identity_hd "(HD) Identity Thief" Disk 0 04/15/13 11/01/13 0 0 0 0 0 0 1 1 0 16000000 H3 16:9 0 0
  hollywoodhd2 3 0 8016 0 930 PG 5347 1 escapep_hd "(HD) Escape from Planet Earth" Disk 0 04/01/13 10/01/13 0 0 0 0 0 0 1 1 0 16000000 H3 16:9 0 0
  hollywoodhd3 1 0 8012 0 930 PG-13 5828 1 darkski_hd "(HD) Dark Skies" Disk 0 04/01/13 10/01/13 0 0 0 0 0 0 1 1 0 16000000 H3 16:9 0 0
  hollywoodhd3 2 0 8007 0 928 PG-13 5735 1 guilttri_hd "(HD) The Guilt Trip" Disk 0 04/01/13 10/01/13 0 0 0 0 0 0 1 1 0 16000000 H3 16:9 0 0
  hollywoodhd3 3 0 8013 0 928 PG-13 7813 1 jackreac_hd "(HD) Jack Reacher" Disk 0 04/01/13 10/01/13 0 0 0 0 0 0 1 1 0 16000000 H3 16:9 0 0
  hollywoodhd4 1 0 7993 0 919 PG-13 9500 1 lesmiser_hd "(HD) Les Miserables" Disk 0 03/06/13 09/01/13 0 0 0 0 0 0 1 1 0 16000000 H3 16:9 0 0

[Titles] の後には、映画の名前とレーティングをテキスト ファイルに入れるだけです。可能であれば、ユーザーにどのファイルから読み取るかを選択するように促したいと思います。そうすれば、他の誰かがプログラムを実行する場合に、誰でもファイルの名前またはパスを入力できます。

私はc ++を使用することを計画していました。ポイントは、プログラムを自動化して、毎月プログラムを実行し、映画のタイトルと評価をコピーして単語に貼り付けて他のすべてのものを削除するのではなく、引き出すことができるようにすることです.

4

2 に答える 2

0

そのファイルを解析する方法について、いくつかの疑似コードを示します。

void Read(stringFileName)
{
     //very self explanatory
}

int FindStr(stringToFind, stringToSearchWith, charDelimeter)
{

    //process
    return indexOfDelimeter;
}

    //stringToFind          - what data in the text are you looking for
    //stringToSearchWith    - in what text should I look for this(assuming you stored the .txt file into a string
    //charDelimeter         - whats the next character after finding the stringToFind.
    //                      - this is important so that you can know whats the corresponding data in that string e.g myFavNum 10000000e-210
    //the delimeter is a `space`

int ConvertToInt(stringToSearchWith, index)
{
    //process
    return toInt;
}

    //stringToSearchWith - assuming that this is only a line in your .txt file,
    //                   - this is where you want to convert string into int
    //index              - where is the data in the string?

概要:

  1. Read

  2. Find

  3. Convert

于 2013-05-25T00:45:03.903 に答える