943,844 Members | Top Members by Rank

Ad:
Nov 18th, 2006
0

Turn [Space] into [tab] in text files

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
WhiteAvenger is offline Offline
3 posts
since Oct 2006
Nov 19th, 2006
0

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

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;
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Nov 19th, 2006
0

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

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
WhiteAvenger is offline Offline
3 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: How to force program to write itself?
Next Thread in Pascal and Delphi Forum Timeline: How to automatic update files from the web





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC