473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Importing text file structured as report

Hi,
I am trying to find the way to import text file which was desined as report, meaning, even though the file is txt, every page contains repeating report header and report footer.
Can anyone have any ideas?
The only method of solution I was able to come up with so far is to distinguish the first character of each line, whether it is number or alphabet. That way, only lines with numbers would be imported, but I would still need help on how to distinguish them either.
Any idea would be appreciated. Thanks
Apr 29 '07 #1
3 1317
Dököll
2,364 Expert 2GB
Hello, dh32470!

What language are you hoping to do this in?

You can if you want, post what you have working thus far for a closer look.

Welcome!

Dököll
Apr 29 '07 #2
Hi, Dokoll,
actually I have not even started yet and wanted to have some lead.
by the way, I am using VB
Apr 29 '07 #3
Killer42
8,435 Expert 8TB
Hi, Dokoll,
actually I have not even started yet and wanted to have some lead.
by the way, I am using VB
What Dököll (note the dots) meant is, what version?

I'll assume VB6 for the moment.

There may be better ways of achieving this, but one simple way would be to use a variation on this code...
Expand|Select|Wrap|Line Numbers
  1. Dim FileIn As Long, FileOut As Long
  2. Dim Text As String, Char As String * 1
  3. FileIn = FreeFile
  4. Open "Report.Txt" For Input Access Read Shared As FileIn
  5. FileOut = FreeFile ' <-- This must come after the first Open statement!
  6. Open "Data.Txt" For Output Access Write Lock Write As FileOut
  7. Do Until EOF(FileIn)
  8.   Line Input #FileIn, Text
  9.   Char = Left(Text,1)
  10.   If IsNumeric(Char)
  11.     Print #FileOut, Text
  12.   End If
  13. Loop
  14. Close
This is untested. But it should read Report.Txt, rip out any lines that start with a numeric digit, and write them to Data.Txt.
May 1 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Joel | last post by:
Hi, I'm importing our DOS data base (Dataflex) to Mysql I have a table with 174,638 records that I convert into a tab delimetered Text file however, Mysql only reads 87,035! I checked the text...
4
by: Xgirl | last post by:
HI! I am importing .txt files. How can i check the errors? I have created a log file, but the problem is that i lose some characters. I import for example: Code ABC FZH JHN
11
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
3
by: ghadley_00 | last post by:
Hi, I have a MS access database into which I need to import a text file that is oriented vertically (fields are listed from top to bottom with the value for each field appearing to the right of...
3
by: R. P. | last post by:
Subject: XSLT to transform a flat XML file into a structured text file I have an XML file that lists the PDF file segment names and titles of a larger document and looks something like this: ...
2
by: Wes Peters | last post by:
Does anyone know of an article that deals with the subject of reading a structured text file using VBA code in Access? Thanks, Wes
0
by: raka61 | last post by:
Hi , I need help in understanding if i can directly(there are 100s of different structured files i get in text format with & hence dont wnat to manually define the structure for each file...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.