|
-
May 10th, 2005, 04:08 AM
#1
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.
ØØ
-
May 10th, 2005, 04:49 AM
#2
Frenzied Member
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!
-
May 10th, 2005, 06:26 AM
#3
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..
-
May 10th, 2005, 07:05 AM
#4
Frenzied Member
If I have been helpful please rate my post. If I haven't tell me!
-
May 10th, 2005, 07:41 AM
#5
Re: Tabulator question.
I love her too...so that is no problem...
ØØ
-
May 10th, 2005, 07:58 AM
#6
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.
-
May 10th, 2005, 08:01 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|