Note that there are some explanatory texts on larger screens.

plurals
  1. POPDF Import into SQL
    primarykey
    data
    text
    <p>I have a pdf file that I converted to seperate HTML files, My goal is to import them into MS SQL so I can search the table for specific identifiers and display the result on a webpage.</p> <p>I am able to read all the html files, and get it into the SQL table, but complete sentences are being cut of by the converter because they are splitted into multiple div containers.</p> <pre><code>&lt;div class="S2"&gt; DA0-17.0&lt;/div&gt; &lt;div class="S5"&gt; 1416&lt;/div&gt; &lt;div class="S2"&gt; Required when the subscriber is the same person as the patient. If&lt;/div&gt; &lt;div class="S5"&gt; 2698&lt;/div&gt; &lt;div class="S2"&gt; the subscriber is not the same person as the patient, do not use&lt;/div&gt; &lt;div class="S2"&gt; this element.&lt;/div&gt; &lt;div class="S4"&gt; CODE&lt;/div&gt; &lt;div class="S4"&gt; DEFINITION&lt;/div&gt; &lt;div class="S2"&gt; 18&lt;/div&gt; &lt;div class="S2"&gt; Self&lt;/div&gt; </code></pre> <p>I am trying to retrieve class S2.</p> <p>I don't need class S5 or S4 Attached is a sample of the SQL results, The insert string is dynamicly created depending on how many fields there are needed.</p> <p><img src="https://i.stack.imgur.com/ev3MV.png" alt="SQL Results"></p> <p>Below is the part the creates the insert values:</p> <pre><code>If iFieldNum = 1 Then sInsertstring = sInsertstring + "id2, " + "num" + CStr(iFieldNum) sInsertValues = sInsertValues + "'" + msbr + "', '" + ms2 + "'" Else sInsertstring = sInsertstring + ", num" + CStr(iFieldNum) sInsertValues = sInsertValues + ", '" + ms2 + "'" End If iFieldNum += 1 </code></pre> <p>Hopefully someone can assist me with this problem or point me in the right direction on how to fix this issue. Complete code is available upon request. Thanks for your time, Robert.</p> <p>Ps: This is application based, not web</p> <p>In reply to Edper:</p> <pre><code>Dim fFileName As String Dim dListing As New DirectoryInfo(My.Settings.ImportDir) Dim aFileArray As FileInfo() = dListing.GetFiles() Dim fFiles As FileInfo For Each fFiles In aFileArray fFileName = fFiles.Name Dim fStream = New FileStream(My.Settings.ImportDir + "\" + fFileName, FileMode.Open) Dim sReader = New StreamReader(fStream) </code></pre> <p>In reply to Edper.<br> What I want is the following:</p> <p>In the HTML files (around 700) are div containers with different class names.</p> <pre><code> &lt;div class="S2"&gt; Required when the subscriber is the same person as the patient. If&lt;/div&gt; &lt;div class="S5"&gt; 2698&lt;/div&gt; &lt;div class="S2"&gt; the subscriber is not the same person as the patient, do not use&lt;/div&gt; &lt;div class="S2"&gt; this element.&lt;/div&gt; </code></pre> <p>I am able to create insert statements for each occurrence, however I want the "Description" between the <code>&lt;div class="S5"&gt;</code> and <code>&lt;div class="S4"&gt;</code> to be one long line of text, at the moment it is split up in 3 parts which I don't want, I don't know how to combine them.<br> My knowledge of VB.NET is fairly limited, and I am trying to learn as I go along, I was pro-efficient in classic ASP but that won't work in this case.</p> <p>I'm sorry for the bad formulation of my question..<br> I simply don't know how else to explain it further.. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload