Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading from text file

Status
Not open for further replies.

unixisgood

Technical User
Jan 26, 2005
25
GB
Hi all,
I can read some line which i want but i have problem with date\time format. While reading it can not get date\time properly.

Text file i read from looks like below;

Date/Time Message
-------------------- ----------------------------------------------------------
30.01.2007 14:35:16 xxxxxxxxxxxxxxxxxxxx


But when i read data and add to listbox or put into another file it looks like,

Date/Time Message
-------------------- ---------------------------------------------
30,01
14 xxxxxxxxxxxxxxxxxxxx

My command is

Print #4, Left(LTrim(readline), 70)
ListBox3.AddItem Left(LTrim(readline), 70)

Any idea?
 
You must be doing something else in your code, because if I do this:
Code:
Dim readline As String

readline = "30.01.2007 14:35:16      xxxxxxxxxxxxxxxxxxxx"

Debug.Print Left(LTrim(readline), 70)
It works fine.

Have fun.

---- Andy
 
If you're looping through a text file and you read in the line:
"30.01.2007 14:35:16 xxxxxxxxxxxxxxxxxxxx"
with the Input statement, the text will be formatted as:

30.01
14
xxxxxxxxxxxxxxxxxxxx

If this is what you are seeing then you need to use the Line Input statement.

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top