Turn [Space] into [tab] in text files

Reply

Join Date: Oct 2006
Posts: 3
Reputation: WhiteAvenger is an unknown quantity at this point 
Solved Threads: 0
WhiteAvenger WhiteAvenger is offline Offline
Newbie Poster

Turn [Space] into [tab] in text files

 
0
  #1
Nov 18th, 2006
Hi guys,

I am currently working on a program that opens a text file and replaces all [Space]s with [Tab]s.
I already know how to read teh text file and write in the new variables, but I just can't figure out how to make a pascal program a) read a [Space] and b) write a [Tab]!

Can anyone help me, please???

Thanks a lot in advance

WhiteAvenger
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 16,628
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1615
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Turn [Space] into [tab] in text files

 
0
  #2
Nov 19th, 2006
I don't reall know pascal, but most languages are pretty much the same. You can do it one of two ways:
1. read the file one character at a time and write the character just read to another file. When a space is read replace it with a tab and write the tab instead.
2. Read the entire line, then search the line for spaces. When a space is found replace it with a tab. Finally wrote the line to another file.

If you still have problems, please post the code you have so we can see what it is doing;
The most important thing in the Olympic Games is not to win but to take part, just as the most important thing in life is not the triumph but the struggle. The essential thing is not to have conquered but to have fought well.
-Pierre de Coubertin, The Olympic Creed Inspired by Bishop Ethelbert
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 3
Reputation: WhiteAvenger is an unknown quantity at this point 
Solved Threads: 0
WhiteAvenger WhiteAvenger is offline Offline
Newbie Poster

Re: Turn [Space] into [tab] in text files

 
0
  #3
Nov 19th, 2006
Ha, ha, very funny...
I ask how the program recognises a [space] and you tell me to read it - I ask how the program regocnizes a [Tab] and you tell me to write it.

Anyway, the Problem is [resolved] as I have just used VB instead.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 4014 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC