Jump to content

PDF to Text to Excel


Recommended Posts

Post #18 is what you get when you run the second Code Quote box in post #16? When I try to run that code it doesn't produce anything because the conditions are never met.

Oh, I'm sorry. I thought you were referring to the alteration of yours this entire time. My aplogies, no i cant get that one to work either, but i'm still working on it.

George

Link to comment
Share on other sites

Gotcha :D now that we're on the same page, the output from that first code box in post #16 looks like what you put in #18, what do you want it to look like after munging with it some more? (can you type up an example?)

Link to comment
Share on other sites

Gotcha :D now that we're on the same page, the output from that first code box in post #16 looks like what you put in #18, what do you want it to look like after munging with it some more? (can you type up an example?)

Ultimately I would prefer this:

7.625 -3.968 -3.84 -3.809 -3.679

7.5 -3.694 -3.57 -3.57 -3.445

7.375 -3.348 -3.23 -3.225 -3.106

7.25 -3.238 -3.125 -3.08 -2.966

7.125 -3.026 -2.918 -2.878 -2.769

7 -2.686 -2.584 -2.564 -2.46

6.875 -2.302 -2.204 -2.184 -2.085

6.75 -1.843 -1.751 -1.693 -1.6

6.625 -1.328 -1.241 -1.149 -1.061

6.5 -0.823 -0.741 -0.675 -0.592

6.375 -0.287 -0.211 -0.14 -0.062

7.625 -3.493 -3.364 -3.314 -3.184

7.5 -3.151 -3.027 -2.972 -2.847

7.375 -3.259 -3.141 -3.08 -2.961

7.25 -3.032 -2.919 -2.853 -2.739

7.125 -2.763 -2.655 -2.584 -2.475

7 -2.395 -2.292 -2.216 -2.112

6.875 -1.947 -1.849 -1.768 -1.669

6.75 -1.431 -1.339 -1.252 -1.159

6.625 -0.949 -0.862 -0.77 -0.682

6.5 -0.421 -0.339 -0.242 -0.159

6.375 0.167 0.243 0.327 0.405

7.125 -3.552 -3.446 -3.339 -3.327

7 -3.281 -3.18 -3.078 -3.061

6.875 -2.898 -2.803 -2.706 -2.651

6.75 -2.61 -2.519 -2.427 -2.329

6.625 -2.426 -2.341 -2.254 -2.16

6.5 -2.135 -2.055 -1.973 -1.874

6.375 -1.712 -1.637 -1.561 -1.457

6.25 -1.294 -1.225 -1.154 -1.045

6.125 -0.569 -0.505 -0.439 -0.388

6 -0.187 -0.128 -0.067 -0.011

5.875 0.282 0.336 0.391 0.421

So each program is seperated, But i would be estatic with:

7.625 -3.968 -3.84 -3.809 -3.679 7.625 -3.493 -3.364 -3.314 -3.184 7.125 -3.552 -3.446 -3.339 -3.327

7.5 -3.694 -3.57 -3.57 -3.445 7.5 -3.151 -3.027 -2.972 -2.847 7 -3.281 -3.18 -3.078 -3.061

7.375 -3.348 -3.23 -3.225 -3.106 7.375 -3.259 -3.141 -3.08 -2.961 6.875 -2.898 -2.803 -2.706 -2.651

7.25 -3.238 -3.125 -3.08 -2.966 7.25 -3.032 -2.919 -2.853 -2.739 6.75 -2.61 -2.519 -2.427 -2.329

7.125 -3.026 -2.918 -2.878 -2.769 7.125 -2.763 -2.655 -2.584 -2.475 6.625 -2.426 -2.341 -2.254 -2.16

7 -2.686 -2.584 -2.564 -2.46 7 -2.395 -2.292 -2.216 -2.112 6.5 -2.135 -2.055 -1.973 -1.874

6.875 -2.302 -2.204 -2.184 -2.085 6.875 -1.947 -1.849 -1.768 -1.669 6.375 -1.712 -1.637 -1.561 -1.457

6.75 -1.843 -1.751 -1.693 -1.6 6.75 -1.431 -1.339 -1.252 -1.159 6.25 -1.294 -1.225 -1.154 -1.045

6.625 -1.328 -1.241 -1.149 -1.061 6.625 -0.949 -0.862 -0.77 -0.682 6.125 -0.569 -0.505 -0.439 -0.388

6.5 -0.823 -0.741 -0.675 -0.592 6.5 -0.421 -0.339 -0.242 -0.159 6 -0.187 -0.128 -0.067 -0.011

6.375 -0.287 -0.211 -0.14 -0.062 6.375 0.167 0.243 0.327 0.405 5.875 0.282 0.336 0.391 0.421

7.625 -3.796 -3.668 -3.637 -3.507 7.625 -3.068 -2.94 -2.889 -2.76 7.125 -3.179 -3.073 -2.966 -2.954

7.5 -3.551 -3.427 -3.427 -3.302 7.5 -2.737 -2.614 -2.558 -2.434 7 -2.933 -2.832 -2.73 -2.713

7.375 -3.171 -3.053 -3.048 -2.929 7.375 -2.486 -2.368 -2.307 -2.188 6.875 -2.596 -2.501 -2.404 -2.349

7.25 -3.116 -3.003 -2.958 -2.844 7.25 -2.212 -2.098 -2.033 -1.918 6.75 -2.303 -2.212 -2.12 -2.022

7.125 -2.904 -2.796 -2.756 -2.647 7.125 -1.978 -1.87 -1.799 -1.69 6.625 -2.029 -1.944 -1.857 -1.763

7 -2.572 -2.47 -2.45 -2.346 7 -1.667 -1.565 -1.488 -1.385 6.5 -1.767 -1.687 -1.605 -1.506

6.875 -2.178 -2.08 -2.06 -1.961 6.875 -1.217 -1.119 -1.038 -0.939 6.375 -1.373 -1.298 -1.222 -1.118

6.75 -1.762 -1.67 -1.612 -1.519 6.75 -0.707 -0.615 -0.528 -0.435 6.25 -0.985 -0.916 -0.845 -0.736

6.625 -1.353 -1.266 -1.174 -1.086 6.625 -0.008 0.079 0.171 0.259 6.125 -0.169 -0.105 -0.039 0.012

6.5 -0.897 -0.815 -0.749 -0.666 6.5 0.617 0.699 0.796 0.879 6 0.205 0.264 0.325 0.381

6.375 -0.413 -0.337 -0.266 -0.188 6.375 1.279 1.355 1.438 1.516 5.875 0.366 0.42 0.475 0.505

Similar to the way they came with your original code.

George

Link to comment
Share on other sites

I've not figured it out yet George, but this is my latest... and may be all the further I get on it tonight.

#include <File.au3>
#include <Array.au3>
#include<string.au3>

Opt ( "TrayIconDebug", 1 )

Dim $array
Dim $NewLine = 0
Global $Line
Dim $y = "-"
_FileReadToArray ( "citi.txt", $array )

FileDelete ( "test.csv" )

For $x = 1 TO $array[0] - 1
    ToolTip ( $x & " ==> "& $y, 0, 0 )

        $SpaceFix = StringStripWS ( $array[$x], 1 )
        $SpaceFix = stringreplace($SpaceFix, "...", " ")
        $SpaceFix = StringReplace ( StringStripWS ( StringStripCR ( $SpaceFix ), 4 ), " ", "," )    
        $Split = StringSplit ( $SpaceFix, "," )
        
    for $y = 0 to $Split[0] - 1

        ToolTip ( $x & " ==> "& $y, 0, 0 )
        $z = StringReplace($split[$y], ".", "")
        $z = StringReplace($z, ")", "")
        $z = StringReplace($z, "(", "")
    
        If StringInStr( $split[$y], ".") and stringisdigit($z) Then
            If Not StringInStr ( $Split[$y], "(" ) And $NewLine = 0 Then
                $Line = $Split[$y] & ","
                $NewLine = 1
            EndIf
            If StringInStr ( $Split[$y], "(" ) And $NewLine = 1 Then
                $Line = $Line & $Split[$y] & ","
                If  Not StringInStr ( $Split[$y + 1], "(" ) Then
                    $y = $y - 1
                    $NewLine = 2
                Else
                    ContinueLoop
                EndIf
            EndIf
            If $NewLine = 2 Then
                FileWriteline ("test.csv",StringTrimRight ( $Line, 1 ) )
                $NewLine = 0
                $Line = ""
            EndIf
        EndIf
    Next
Next
Link to comment
Share on other sites

#include <File.au3>
#include <Array.au3>
#include<string.au3>

Opt ( "TrayIconDebug", 1 )

Dim $array
_FileReadToArray ( "C:\test.csv", $array )

FileDelete ( "C:\test2.csv" )

Dim $maybe
$lineprev = 0
$dataprev = 0

$a = 0



For  $x = 1 TO $array[0] - 1
    ToolTip ( $x, 0, 0 )
    
        $Split = StringSplit ( $array[$x], "," )

        $line = number($Split[3])
        $data = $Split[1]
        
    if $line > $lineprev Then

            FileWriteLine ("C:\test2.csv", $dataprev & "," )
            $dataprev = $data 
            $lineprev = $line 
            $a = $a + 1 ; starting to put in a counter and reverse counter

    elseif $line = $lineprev then 
        $datanew = _StringInsert($dataprev, "," & $data, stringlen($dataprev))
            $dataprev = $datanew
            $lineprev = $line 

    EndIf
Next

Check this out! Been working on it for a long time. Pretty much dwelling over it since my last post.

It rebuilds the tables... kinda, after your modified code runs, i run this one.

Now I'm trying to space each section out so that the first entry is 50 lines from the next first entry (so i can have a stable excel sheet formula that uses the cell references) Then i can use a customized program for each sheet to divi up the lines that have like 3 or more tables.

George

Edit: Saw your post after i posted mine, Give me time to study yours, takes me a long time still :D

Edited by Sorak99
Link to comment
Share on other sites

Your code looks right on track, moreso even than mine I think... You could look at mine to see how I was trying to do stuff, but I think we should try to get what you came up with working. :D

Sounds good

Edit: possible to write to a specifi line? my variable doesnt work.

Edited by Sorak99
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...