Find the answer to your Linux question:
Results 1 to 10 of 10
Hello everybody, It's 2 days as I installed Ubuntu 8.04 and am greatly enjoying it. I want to learn programming in Python. On current stage I want to know what ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    7

    Programming Newbie

    Hello everybody,

    It's 2 days as I installed Ubuntu 8.04 and am greatly enjoying it. I want to learn programming in Python.

    On current stage I want to know what is a structure (if this is a correct word) of files and how can I change/rebuild them in a way I need.
    Why is that some files can be transformed into others by simply changing their names' suffixes, like .txt into .html, while other files need a program to transform them into other types, like .mp3 to .wav needs a Converting soft?


  2. #2
    Linux User dxqcanada's Avatar
    Join Date
    Sep 2006
    Location
    Canada
    Posts
    259
    LInux has no special meaning when it comes to a file name extension.

    You are not converting a file by changing it's extension.
    You are just renaming it.

    Now ... there are some Window/Desktop/File Managers that look at the file name and then makes a decision on what application can open it. A number of applications in Linux do not care what the file extension is (or even it has an extension).

    If you take an audio file and put a ".txt" extension on it ... then some applications will assume it is a text file.



    Men occasionally stumble over the truth,
    but most of them pick themselves up
    and hurry off as if nothing had happened.

    Winston Churchill


    ... then the Unix-Gods created "man" ...

  3. #3
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by ottoshmidt View Post
    Hello everybody,

    It's 2 days as I installed Ubuntu 8.04 and am greatly enjoying it. I want to learn programming in Python.
    Google for

    Code:
    python tutorials
    and you will get more than you need.

    On current stage I want to know what is a structure (if this is a correct word) of files and how can I change/rebuild them in a way I need.
    Erm... try describing what do you want instead of using inaccurate words. I can't figure what you are asking.

    Why is that some files can be transformed into others by simply changing their names' suffixes, like .txt into .html, while other files need a program to transform them into other types, like .mp3 to .wav needs a Converting soft?
    False. Renaming a file doesn't change it's contents. A txt file is not automatically converted into a web site by just renaming it. Maybe you mean that msword can save a doc or txt file as html, but that is not just a rename operation. That, indeed, changes the contents of the file to addapt it to the new type.

    Conversion from txt to pdf or html requires conversion of the internal data of the file, just like conversion from wav to mp3 means compression of the data to addapt it to the new codec.

  4. #4
    Just Joined!
    Join Date
    May 2008
    Posts
    7
    That, indeed, changes the contents of the file to addapt it to the new type.
    What does changing the content of the file mean technically???


    Conversion from txt to pdf or html requires conversion of the internal data of the file, just like conversion from wav to mp3 means compression of the data to addapt it to the new codec.
    I understand it like wav and mp3 files are built (made, written, created) with the same "bricks" ("blocks"), but in mp3 these "blocks" are compressed (reduced in physical volume). Do I get it right?

    Erm... try describing what do you want instead of using inaccurate words. I can't figure what you are asking.
    OK, Let me put it straight: I want to make a Dictionary in, for example "OpenDict", than I want to share these files with other people, even with those who use other applications, for example, "Lingvo" on Windows, "OpenDict" exports one type of files which Lingvo cannot "see". So, am I able to write a program converting those OpenDict Files (.dwa) into LIngvo reading ones (.lud or something) and if yes, can anyone do me a favor and teach me how, knowing that I am an absolute beginner??? (I'm not an egoist, I just want to be involved in the community)

    P.S. dxqcanada and i92guboj, thank you for explaining the difference between file extention and content. And I will google Python Tutorials, )))

  5. #5
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by ottoshmidt View Post
    What does changing the content of the file mean technically???
    Technically, it means that the bytes that the file contains will no longer be the same once you do the conversion.

    I understand it like wav and mp3 files are built (made, written, created) with the same "bricks" ("blocks"), but in mp3 these "blocks" are compressed (reduced in physical volume). Do I get it right?
    Mostly, but mp3 is a complex algorythm where, except for keypages, there's no guarantee that you can play a given frame unless you have all the previous ones decoded first. It's not just a simple compression algorythm. Add to that that it's lousy, so, there must also be a way to decide which pixels can be discarded and which other cannot.

    OK, Let me put it straight: I want to make a Dictionary in, for example "OpenDict", than I want to share these files with other people, even with those who use other applications, for example, "Lingvo" on Windows, "OpenDict" exports one type of files which Lingvo cannot "see". So, am I able to write a program converting those OpenDict Files (.dwa) into LIngvo reading ones (.lud or something) and if yes, can anyone do me a favor and teach me how, knowing that I am an absolute beginner??? (I'm not an egoist, I just want to be involved in the community)
    I suppose that nothing is impossible. The big problem is that I don't know what Lingvo is and what format it's dictionary uses. I suppose that if the format is open and well documented, it shouldn't be so complicated to write a conversion utility (if there's not one yet around).

    Maybe someone who knows what Lingvo is and owns a copy or at least some dictionaries (or at least the specifications for these dictionaries) can help better than me.

  6. #6
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    Maybe post a sample file of each...you can zip them up and attach them. If it's just a simple case of formatting it may be something that can be scripted with sed or similar.

  7. #7
    Just Joined!
    Join Date
    May 2008
    Posts
    7
    oh, where can I attach them?

  8. #8
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by ottoshmidt View Post
    oh, where can I attach them?
    There are many free file hosting services that can host the files on the internet for you. Google for this:

    Code:
    free file hosting
    And you will find many. They might require registration (some of them does not though those are harder to find). Once you upload one file, they give you a link to access that file, post the links here so we can download and review the files.

    If the files are plain text you could also use pastebin.com, the problem is that pastebin might change slightly the format of the file, which we don't don't if we are gonna do something useful with the files.

  9. #9
    Just Joined!
    Join Date
    May 2008
    Posts
    7
    this is the file OpenDict exports
    file1

    And these files can be imported in lingvo. actually only one of them (I'll type wich one) but all these three files should be present:

    file1
    file2
    file3

  10. #10
    Just Joined!
    Join Date
    May 2008
    Posts
    7
    Ok. For Lingvo .lud is an editable dic and .lsd non-editable.

Posting Permissions

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