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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splitting a long long structured string in a field of a table

Status
Not open for further replies.

leocarter

Programmer
Jul 8, 2003
16
0
0
US
I'm capturing a printing string from a Dos computer to bring it to Windows. I'm having success in putting it, in an Access table. The biggest record has 7000 characters and all comes in an organized way, using always the same space. All records comes the way they go to a printer and in a form of the table I can see the record as it shows in the print. I want to know if there is a way to reconstruct the array that is coming in a tacit way in the data with a Vb module. Or.., I forget this and try to solve it capturing the fields using some kind of code that use a space delimiter action. How? Thanks in advance.
 
Hi

If the data is fixed format, which it sounds like it is, you can import it into Access, and using an Imposrt Specification, you can automatically break the string down into individual fields

See File\Import, in the dialog box, choose file type text (.txt) and then click the Specifications button

Once you have set up teh specification, the import can be done in code using DoCmd.TransferText

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi Ken,
Thanks for your soon reply.
As I'm capturing the data from Dos plattform I'm not able to import-export the file. It is just poping in the field of the table.
I'm converting the paralel data from the Dos computer to serial data and getting it via serial port.
I did try to use Excel as a bridge to use the "text to columns" (or the import-export in Access that allow me, also, to trim the string), but it didn't accept the strig because its large.
Thanks again.
Leonardo
 
Hi

OK, in that case, you will need to break teh string up using the string manipulation functions, see

Left(), Right(), Mid(), Instr() in help, these functions will enable you the break the string down into columns

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Re-direct the output to a text only file printer. Then use the specification to Import.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top