Converting strange formated txt file to Access Database

I have a large txt file that is formated in a strange way (see attachment).

Note that it is not tabs the makes the indents, but four spaces.

Is it in any way possible to convert this file to an Access Database with the six fieldnames (NAME, SYNOPSIS, SYNTAX, DESCRIPTION, RELATED LINKS, REMARKS)?

And if it is possible, how on earth is it done?

Regards
Kasper K
sample.txt
Kasper KatzmannSeniorkonsulentAsked:
Who is Participating?
 
als315Connect With a Mentor Commented:
Test this sample.
TextImport27867124.mdb
0
 
peter57rCommented:
This will have to done in code (maybe quite a lot of code, depending on the requirements)
But can you clarify what the outcome has to be.

Are you saying that, for a given Name,   everything between say SYNTAX and DESCRIPTON  goes into the same field and similarly everything between  DESCRIPTON  and RELATED LINKS goes into one field.  In genereal is there just one record for a given Name/Synopsis or does your illustration mean that you are expecting to create multiple records for the same Name/Synopsis?
0
 
Kasper KatzmannSeniorkonsulentAuthor Commented:
What I am thinking is that all data between each field name are written in to a new record with the content under the other fieldnames in their block.

Id   Name   Synopsis   Syntac   ...
1    A1         A2             A3
2    A7         A8             A9
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
als315Commented:
Have you tested my sample? Results are in separate fields in table ImportedText. If you don't need multiline text, remove vbCrLF after line.
0
 
Kasper KatzmannSeniorkonsulentAuthor Commented:
I'm out of office for today. I will check tomorrow tell how it works for me :-)
0
 
Kasper KatzmannSeniorkonsulentAuthor Commented:
Hi again. It seems to work, but not only on the sample file. I get an error message stating that "The field is to short for the amount of data you're trying to add. Try to add less data." (Translated from danish).

When I hit Debug, this line is highlighted: rst("[" & SectionName & "]") = rst("[" & SectionName & "]") & Trim(Str) & vbCrLf
0
 
als315Commented:
Have you changed anything in my sample?
0
 
als315Commented:
You have text length in some fields more then 255 characters, so in example memo fields were used
0
 
Kasper KatzmannSeniorkonsulentAuthor Commented:
A little typo from me. I should have written "It seems to work, but only on the sample file."

I haven't  changed anything and it works great with the sample file.
You're right. Some of the fields contains more than 255 characters. In fact, it could be all of them, except the Name field.

Sorry for the confusion.
0
 
als315Commented:
You can look at content of SectionName in debugger - it is name of field, where type should be changed to MEMO. May be you can prepare new sample with problems. May be some parts are missing?
0
 
Kasper KatzmannSeniorkonsulentAuthor Commented:
Yes yes yes!!
You are my hero. I buy you a beer next time you are in Denmark :-)

The case was, that I had made an extraction of all available Exchange 2010 Powershell commands including their help text from Exchange Management Shell. Now, with your help, it has been put into an Access Database for easier accessibility.

I have attached the database for anyone who might find it usefull.
PowerShell4Exchange2010.mdb
0
 
als315Commented:
Will be glad to see you in Russia.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.