Results 1 to 7 of 7

Thread: Tabulator question.

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Tabulator question.

    I have a lot of files that I am analysing. But it is hard to do it, becasue on some lines uses tab in stead of spaces, and some mix them and so on.


    So I was thinking to make a script that went through all the lines in all the files, and replaces the tabs with spaces. What I am wondering about now, is that these files has been compiled using 4 diffrent OSes and many many different text editors. And they probably have different tab width. Will that make a difference at all in my script, or will I just have to check what the tab width is when I am opening the file on my machine and then replace the tabs with that many spaces.

    This is really importent that it doesn't get messed up, so please don't answer if you are not totaly sure.


    Thanks.
    ØØ

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: Tabulator question.

    Tab is a character itself (ASCII character 9). Different applications set tab widths differently according to the configuration of the program - most editing programs allow you to specify the number of spaces for each tab (so you can control the formatting for ease of reading).

    I would suggest deciding how many spaces you think a tab should be and replace each one with that number. Unforunately if a user has edited a file and used a different space to tab ratio then it won't look quite right - I can't see a way around this sorry.

    HTH

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  3. #3

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Tabulator question.

    Well that is my concern. Because every line has to be 74 (75 included linefeed) long. I just tested it, and found out that it is not actualy more then 568 lines. And about 50% of them is actualy caused by other errors then switching tab with space (eg, adding an extra space on the line). So I sendt a 50pages e-mail to one of my secretary and made her correct them manualy......I have soooo always wanted to do that..

  4. #4
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131

    Re: Tabulator question.

    I bet she loves you!

    DJ

    If I have been helpful please rate my post. If I haven't tell me!

  5. #5

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Tabulator question.

    I love her too...so that is no problem...


    ØØ

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Tabulator question.

    Tab represents 8 spaces almost everwhere I can think of except in Code where it's usually 4 spaces.
    I don't live here any more.

  7. #7
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Tabulator question.

    If he has this much data then its probably a text-dump of Noteme's "little black book"
    I don't live here any more.

Posting Permissions

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



Click Here to Expand Forum to Full Width