Find the answer to your Linux question:
Results 1 to 5 of 5
Hello All, I have a small problem that I would like to solve with C/C++ code.Currently, I am doing it with bash scripting, but it is slow for the application ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    8

    Eliminating data in the two files using tags..

    Hello All,

    I have a small problem that I would like to solve with C/C++ code.Currently, I am doing it with bash scripting, but it is slow for the application and does not always give desired results.

    problem is :

    file1

    Code:
    >seq 1
    agagugaiuididhiuhfdiuhfiu
    >seq 2
    sfdesdfdsfsdfdsfsdfd
    >seq 3
    hiodfhiodhfiodoijfdoj
    >seq 4
    jfiodjiosfdiojfiodjojfsjd
    file 2:
    Code:
    >seq1
    agagugai-u---ididhiu--hfdi--uhfiu
    
    >seq 2
    sf-desdfdsf-s-dfd-sfs-dfd
    Result after running the program:
    Code:
    >seq 3
    hiodfhiodhfiodoijfdoj
    >seq 4
    jfiodjiosfdiojfiodjojfsjdo
    i.e. The "tags" that are common in the two files are eliminated with their corresponding data and is stored in another file...

    To explain further :
    By tag i mean ">seq2" etc. at the start of every data.
    The objective is that 2 files are read and the tags which are in common b/w the 2 files along with it data will be eliminated. The new result is written in newfile.

    forexample:
    In the above example, file1 contains seq {1234} and file2 has seq {12}. Therefore the 2 tags common b/w 2 files are seq {12}, though the data is bit different. These 2 tags along with their data is eliminated and is written in a newfile.


    Any help would be highly appreciable...
    Thanks in Advance

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Doing this in C or C++ is trivial. If you know C or C++, you can do this easily.

    Do you have a specific C or C++ question that's getting in the way? We'd be glad to help with that!
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    8
    Problem is that I am a newbie in C/C++ and i dont know how to do it...

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    You said that your bash script doesn't always give the desired results. The first thing would be to find that bug and fix it. Then the bash script would be a good "design document" to show what you want to do in C.

    You've been working with C since, what, July of last year? If, after this half year, you're still not too familiar with C, then google this:
    Code:
    C tutorial
    and you'll be on your way!

    Good luck!
    --
    Bill

    Old age and treachery will overcome youth and skill.

  5. #5
    Just Joined!
    Join Date
    May 2007
    Posts
    8
    There is no need to be rude dear;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...