Query Help

mlr0911

Registered User.
Local time
Yesterday, 23:58
Joined
Oct 27, 2006
Messages
155
I have a text document that is linked and am trying to run a query off of that document.

I have all of my queries working great except for one thing......if a comment line drops to the next line, I'm not able to capture it.

Example:

12345
; This is the comment line.

I need to get the comment line on the first line.

Example
12345 ; This is the comment line.

Does anyone know how I can do this and make sure that the comment line is associated with the rest of the field?

Thanks
 
I thought of that; however, it is in the same field as the account number (from the text document). If if was in a different field, I can see doing a concatenate, but since it is within the same field, I can't do it.
 
What is actually in your account number field. Is it

12345
; This is the comment line

If so you can replace the cr lf in the string with a space character.
 
But how would I get all of the information on 1 line (i.e. the same field) like:

12345 ;This is the comment line.
 
In query newfield: = 12345 + This is the comment line.

Display newfield
 
If I'm reading this properly you currently are storing data in ONE FIELD like displayed. The next question would be why? It is this storage way that, because it isn't good, is going to make it really difficult to get what you want. Is this something that comes from another system and you don't have the ability to change the source?
 
Yes, we get this report from another vendor and it comes accross this way.
 
How are you currently putting the data into the database? I'm thinking that it might be easier to put it in right to begin with so you don't have to worry about this.
 
I have the text file linked as a delimited file and using a query off of that table. This file can have anywhere from 100 to 1000 entries.
 
Is it possible to see the text file? I realize it may not be possible, but if I can see it I can probably write a function to import it in the way that it should be to save you the headache of using workarounds.
 
Bob

I have attatched an example of the information.
I have tried to get everything on one line, but I haven't had any success.

Thanks for your help.
 

Attachments

Any way you can include more than one record? It would help to see how it looks with more than one.
 
Sure.

As you will see, some of the files won't have a ";" comment line.

Thanks
 

Attachments

Okay, that's actually helpful. I'll see what I can do.
 
Bob

Have you been able to work on the text file?
 
Here you go!

Here's the sample database that will import the text file into one line when there are two lines for that particular item.

You will probably need to tweak it to fit your stuff, but hopefully this will get you on your way.
 

Attachments

Users who are viewing this thread

Back
Top Bottom