Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
WTG
 
Posts: n/a
Default Reading a text file ?

Help! :(

Is there a way to automate the importation of a text file in to Excel,
with out having to use the import text wizard every time?

Below is a sample the the file and the inofrmation I need. ( the file
is actually much larger then this) but this will give you an idea. The
actual numbers will change from day to day,and so will the amount of
rows. But the file format and the number of columns will always be the
same. and the information I need will always be the same columns.

I've read books, tutorials and even information on dos batch files. :(

I'm stuck, I have my whole spread sheet planned out. All my reports
and summarys but it's usuless without the ability to import this
information.

SOMEONE PLEASE HELP !!!


Thank you.

WTG.

SAMPLE:

Actual Text File:

000000000 07:5007:50 PON 0000<MN22400130
000000000 08:1608:16 PON 0000<MN22400140
000000000 11:2211:22 PON 0000<MN22400120
000000000 11:4711:47 PON 0000<MN22400115
000000000 06:1306:13 PON 0000<MN22400155

Actual Information needed:

07:50 PON 22400130
08:16 PON 22400140
11:22 PON 22400120
11:47 PON 22400115
06:13 PON 22400155
  #2   Report Post  
Steve
 
Posts: n/a
Default

You could use Line Input #

From help:
Dim TextLine
Open "TESTFILE" For Input As #1 ' Open file.
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, TextLine ' Read line into variable.
Debug.Print TextLine ' Print to the Immediate window.
Loop
Close #1 ' Close file.
You'd need to the mid function on Textline to assign values to
variablesHTHSteve
"WTG" wrote in message
...
Help! :(

Is there a way to automate the importation of a text file in to Excel,
with out having to use the import text wizard every time?

Below is a sample the the file and the inofrmation I need. ( the file
is actually much larger then this) but this will give you an idea. The
actual numbers will change from day to day,and so will the amount of
rows. But the file format and the number of columns will always be the
same. and the information I need will always be the same columns.

I've read books, tutorials and even information on dos batch files. :(

I'm stuck, I have my whole spread sheet planned out. All my reports
and summarys but it's usuless without the ability to import this
information.

SOMEONE PLEASE HELP !!!


Thank you.

WTG.

SAMPLE:

Actual Text File:

000000000 07:5007:50 PON 0000<MN22400130
000000000 08:1608:16 PON 0000<MN22400140
000000000 11:2211:22 PON 0000<MN22400120
000000000 11:4711:47 PON 0000<MN22400115
000000000 06:1306:13 PON 0000<MN22400155

Actual Information needed:

07:50 PON 22400130
08:16 PON 22400140
11:22 PON 22400120
11:47 PON 22400115
06:13 PON 22400155



  #3   Report Post  
WTG
 
Posts: n/a
Default




Thanks I'll give it a try



On Tue, 22 Feb 2005 12:04:12 +1100, "Steve"
wrote:

You could use Line Input #

From help:
Dim TextLine
Open "TESTFILE" For Input As #1 ' Open file.
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, TextLine ' Read line into variable.
Debug.Print TextLine ' Print to the Immediate window.
Loop
Close #1 ' Close file.
You'd need to the mid function on Textline to assign values to
variablesHTHSteve
"WTG" wrote in message
.. .
Help! :(

Is there a way to automate the importation of a text file in to Excel,
with out having to use the import text wizard every time?

Below is a sample the the file and the inofrmation I need. ( the file
is actually much larger then this) but this will give you an idea. The
actual numbers will change from day to day,and so will the amount of
rows. But the file format and the number of columns will always be the
same. and the information I need will always be the same columns.

I've read books, tutorials and even information on dos batch files. :(

I'm stuck, I have my whole spread sheet planned out. All my reports
and summarys but it's usuless without the ability to import this
information.

SOMEONE PLEASE HELP !!!


Thank you.

WTG.

SAMPLE:

Actual Text File:

000000000 07:5007:50 PON 0000<MN22400130
000000000 08:1608:16 PON 0000<MN22400140
000000000 11:2211:22 PON 0000<MN22400120
000000000 11:4711:47 PON 0000<MN22400115
000000000 06:1306:13 PON 0000<MN22400155

Actual Information needed:

07:50 PON 22400130
08:16 PON 22400140
11:22 PON 22400120
11:47 PON 22400115
06:13 PON 22400155



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
why are there quotes in my exported text file? Gordon Excel Discussion (Misc queries) 2 February 16th 05 06:59 PM
how do I enable "import text file" excel 2002? jw_schmid Excel Discussion (Misc queries) 2 February 9th 05 10:39 PM
How To Import Text File With No Delimiters? Sam Excel Discussion (Misc queries) 1 February 8th 05 05:54 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
Convert text file to MS_Excel Aqua Flow Excel Discussion (Misc queries) 1 November 30th 04 02:55 AM


All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"