Results 1 to 5 of 5
  1. #1
    Jk254 is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2012
    Posts
    1

    Convert Text String (Not Uniform) to Access db

    Hello experts,

    I am a newbie at writing code which would be helpful in this task.

    I have a lot of records in the text string exmple below. Here is the scenario;

    The colored char (bolded font) are related to specific fields that I am interested in. The uncolored chars (regular font) are fields I am not interested in.
    If I can elaborate:
    V1 would be equal to field 1
    ABCDEFGHI = Field 2
    0012345 = Field 3 and so on
    Now here is the problem in some of the text strings there is some additional information that causes the fields not to be in sync. Here is an example. I have 2 text strings but for the Text String 2 there is some additional information colored in yellow chars (italic font) which I do not need and when I use delimiters it throws my fields off sync because it picks up both the field I need In Blue colored chars (Bolded font) and also chars I don’t need (regular font). Also in the Text String 2, APT SUBZERO (italic font) is not there making it more out of sync. Also in Text String 1 the person has no middle initial but “PER*MEM” (Italic Font) which is also causing my fields not to sync up when using delimiter. I believe by using Code or VBA a command can be put to pick the blue colored chars only (Bolded font) in both strings. I am still new at using code and would like some help in figuring this out

    My ultimate objective is to convert it in access to an access db table when I can then copy it to excel so that in future when I get a similar file I can run it through the same db using the code already set up. Thank you



    Text String1*ABC*Y*18*001*V1*A*E**AC**Y*REF*0F*ABCDEFGHI*REF*1L*0012345*REF*23*XYZ123456*LBC*256*EA*20111215*DTP*473*EA*20120401*DTP*474*EA*20120430*DTP*473*EA*20120501*MN1*IL*1*JANE*DOW*PER*MEM*ZP**TEL*555555555*P3*1234 S SOUTHPOLE APT SUBZERO*APT SUBZERO*N4*SOUTHPOLE*AP*00000**CY*101*DMG*EA*19131213
    Text string 2
    *ABC*Y*18*001*V1*A*E**AC**Y*REF*0F*ABCDEFGHI*REF*1L*0012345*REF*23*XYZ123456*LBC*256*EA*20111215*DTP*373*EA*20120401*DTP*374*DTP*473*EA*20120401*DTP*474*EA*20120430*DTP*473*EA*20120501*MN1*IL*1*JANE*DOW*E*ZP**TEL*555555555*P3*1234 S SOUTHPOLE *N4*SOUTHPOLE*AP*00000**CY*101*DMG*EA*19131213

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I think you are out of luck here. MS Access deals with text, yes, but when reading text from a file or otherwise manipulating it, Access knows nothing about formatting, colour, font, etc about the text. Formatting is a display feature - nothing else. The only way to do that would be to include the formatting information as part of the text, the way HTML does, e.g. <b>This is bold </b> .

    What is the source of those long strings? Is there a way of including delimiters (*) even when some data (fields?) is missing? That would at least make all the string the same in terms of fields counts.

    John

  3. #3
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    is the text REALLY colored or is that just the example that you're using here on the forum?

    and hey John, is the <b> tag really still used in HTML? we're at v.5 now for HTML...I thought <strong> was a replacement for that loooong ago!

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Help_Me -

    Take a look at the source for this web page! The main (constant) parts use <strong>; our messages use <b>. Go figure.

    J.

  5. #5
    help_me_with_access is offline help_me_with_excel
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    262
    well then whoever obviously wrote the vbulletin update wasn't being consistent?

    perhaps they were more concerned with the XSS security issues, like making sure the logout hash validation worked properly? Not sure why though....it's not like Matrix is storing credit cards numbers here...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 14
    Last Post: 04-10-2012, 06:37 AM
  2. How to Convert string to Number?
    By taimysho0 in forum Programming
    Replies: 1
    Last Post: 02-24-2012, 01:57 PM
  3. Can access take one text string and split it into two?
    By hobsondm01 in forum Database Design
    Replies: 2
    Last Post: 06-09-2011, 09:09 AM
  4. Replace a string/text in ms-access db
    By anziga in forum Queries
    Replies: 4
    Last Post: 12-31-2010, 06:40 PM
  5. Convert string to date
    By ~SwAmPdOnKeY~ in forum Queries
    Replies: 4
    Last Post: 09-11-2008, 07:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums