Convert TAB to spaces

Please help!How do I convert/cast TABs in a .txt file to a certain amount of spaces?
[98 byte] By [lotiva] at [2007-10-2 4:48:06]
# 1
See String.replace
tjacobs01a at 2007-7-16 0:52:50 > top of Java-index,Java Essentials,Java Programming...
# 2
Let me rephrase my question.What character is a tab in a txt file? What would I compare it to fro exampleString c;If (c == tab) {}What would I use instead of tab?
lotiva at 2007-7-16 0:52:50 > top of Java-index,Java Essentials,Java Programming...
# 3
"\t"
camickra at 2007-7-16 0:52:50 > top of Java-index,Java Essentials,Java Programming...
# 4
> "\t"The tab character is \t so you should compare against '\t'.Kaj
kajbja at 2007-7-16 0:52:50 > top of Java-index,Java Essentials,Java Programming...
# 5

Here's a program to convert tabs to spaces where tab is deemed to be every 6th position: 6, 12, 18, 24, .... Change accordingly if you have different preference.

import java.io.File;

import java.io.FileWriter;

import java.util.Scanner;

public class ConvertTabs

{ public static void main(String[] args)

{ Scanner input;

FileWriter output;

String line;

try

{ input = new Scanner(new File(args[0]));

output = new FileWriter(args[1]);

while(input.hasNext())

{line = input.nextLine();

int pos = 0;

for(int i=0;i<line.length();i++)

{ if(line.charAt(i)=='\t')

{ int remainder = pos % 6;

for(int j=5;j>=remainder;j--)

{ output.write(' ');

pos++;

}

}

else

{output.write(line.charAt(i));

pos++;

}

}

output.write("\n");

}

input.close();

output.close();

} catch (Exception exception) {}

}

}

Amarisa at 2007-7-16 0:52:50 > top of Java-index,Java Essentials,Java Programming...