Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi there, I am really new to perl and I am trying to develop code using mac. I need to open a file that has an extension of 'SEQ' and then what I need to make a change to one of the parameter value and save it back in the same format. I can open the file in terminal but it doesn't show up nicely. I was thinking if I can open this file in excel and change value to one of the field and saving it back in the same extension Please let me know how can it be done! or give me some examples Thanks a bunch!
  • Comment on Open a sequence file and changing one of the parameter and

Replies are listed 'Best First'.
Re: Open a sequence file and changing one of the parameter and
by GrandFather (Saint) on Sep 10, 2010 at 20:46 UTC

    Is the file an Excel file? If not then what you propose is very unlikely to get you any further forward (and the Perl component of the solution is not obvious). If the file doesn't render well treated as text then it is likely that the format is too complicated to guess at - have you a specification for the file format?

    Unless someone just happens to know the format of the file you wish to manipulate, you will have to provide more information than you have for us to provide much help. We can point you at open and the various other Perl tools that you may need, but on their own that's not going to get you much further forward either.

    The next move is yours - find out the file format, write some code, come back here if you encounter problems with the Perl aspect of the task.

    True laziness is hard work
Re: Open a sequence file and changing one of the parameter and
by dasgar (Priest) on Sep 10, 2010 at 21:07 UTC

        I was thinking if I can open this file in excel...

    I'd recommend against doing this. Excel has a nasty habit of rearranging the contents and adding a bunch of extra junk into the file. At least it does on Windows when messing with XML files.

        I can open the file in terminal but it doesn't show up nicely.

    My guess here is that either this is a binary file (an example is a .jpg file) or has some encoding that your 'terminal' is not using/expecting. As GrandFather has pointed out, you probably need to find out more about the file format and provide that information before others can offer suggestions on how to read the file.