Note that something happened to column2where its contents of column2 are seperated by pipe delimiters messing up the integrity of the data. "|column2|more contents of column3|and some more contents of column4 |more contents of column1|more contents of column2|more contents of column3|more column4 |contents of column1|contents of column2|contents of column3|contents of column4 I have a flat file, pipe delimited such as this: ![]() I know even simple problems can become even more problematic when you don't. ![]() Open strFile For Binary Access Write As #ff 'strBuffer = Replace(strBuffer, Chr(34), "") 'vbNullString StrBuffer = Replace(strBuffer, Chr(29), " ") ![]() StrBuffer = Replace(Replace(strBuffer, vbCrLf, ""), Chr(13) & Chr(13), Chr(13)) 'vbNullString StrBuffer = midReplace(strBuffer, vbTab, "") Open strFile For Binary Access Read As #ff Here is my complete code for scrubbing the data: They need to be remove so the content stays in one column. The problem is with the TABS after each quotation mark. MCr = Carriage Return and mLF = Line Feed if they are together (i.e., CRLF) they get removed. I am able to deal with the unwanted Line Feeds and Carriage Returns per the code below. This represents about what you see when using notepad++ showing all characters)īlah blah->blah blah blah->->blah blah blah blahLFįailure caused by importing bullet points. ![]() Text File (MyText.txt) tab delimited (I am using a hyphen and a greater than sign to represent a TAB. Problem: Importing a flat file with bullets that causes the import to fail. I have looked at this long enough to better explain it. It's the IF statement that fails - and I think it's because of my understanding of how it skips through a text file vs a table. StrBuffer = Replace(strBuffer, vbTab, "") works.
0 Comments
Leave a Reply. |