|
| ||||||||||
| Tags: script, txt file |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| Reading a text file divided by tab
Quote:
|
|
#2
| |||
| |||
| Re: Reading a text file divided by tab
I am acquainted with dealing the files in hard drive by designing codes in C language. I can’t tell you exactly how to make a code for your need. It will need some intensive research and time. But you can use the ‘strtok’ to pass the string pointer along with literal strings which have the required delimiters. In this method, every time you initialize ‘strtok’, it will pass null values instead of string pointers. This will help you to pass next token from the string that you have targeted. The best thing about ‘strtok’ is that it will start returning null values when t will fail to find more data. |
|
#3
| ||||
| ||||
| Re: Reading a text file divided by tab
According to the method suggested by BBC123, the code might give you the data of your documents with tab strokes removed. But I think that it will mess the pattern of the data in which you have made it. By messed up data, I mean that though it might recognize the tab strokes in your data, it might fail to recognize ‘Enter’ command or maybe Shift + Enter’ whatever that you have used to go on the next line. Because of this, the data between the lines may appear continuous and you might need to take few more efforts to separate them. Adding code to recognize the Enter or any other command that is used to enter the next line will be more tedious. |
|
#4
| ||||
| ||||
| Re: Reading a text file divided by tab
I agree with Elias Blackman and his concept of getting possible errors. But I think that if While command is added in loop such that value will go on incrementing, I think that script for getting tab strokes out of the data will start recognizing the difference between two lines. Every time the While loop is initialized the script should check for next valid tab stroke in the file. Also the output should be generated on next line; maybe you could use something close to \n command for getting the new line entry in the output.
__________________ One cries because one is sad. For example, I cry because others are stupid, and that makes me sad. |
|
#5
| ||||
| ||||
| Re: Reading a text file divided by tab
I made a script that I think will help you to get the tab strokes out of your notepad document. I used C++ to get the things done. I have posted the code for you which you might find helpful. I have used the getline method for the code to recognize the new line and to parse all the strings in the line, I have used istringstream class. I hope it is useful for you. ![]() |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Reading a text file divided by tab" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to convert image text into a text file | Wadee | Windows Software | 5 | 02-12-2010 05:33 PM |
| Reading text file in VC++ display it in textbox | molocas | Software Development | 1 | 26-07-2010 10:34 AM |
| Reading XML file with ASP | Dharamsi | Software Development | 4 | 10-03-2010 09:47 PM |
| Problem reading a text file | Vodka | Software Development | 5 | 26-02-2010 03:02 AM |
| Reading text string from text file (PHP) | Moderate | Software Development | 3 | 16-01-2009 02:27 PM |