qfx2qif Quicken qfx to qif file converter

User projects written in or related to FreeBASIC.
jsherk
Posts: 82
Joined: Jun 09, 2006 22:40
Contact:

qfx2qif Quicken qfx to qif file converter

Postby jsherk » Nov 22, 2008 8:46

Both QFX and QIF files are just text files, so all it really does is look for stuff in one file, reorder it, and stick it in the other file!!!

I used FBEdit for FreeBasic along with iGUI.

BACKGROUND:
I have been using Quicken XG 2005 on Windows 98 and Windows XP since it came out. As of Oct 2008, the Web Connect feature has been discontinued!

The only two formats that can be imported into Quicken 2005 are either QFX or QIF, but since the Web Connect feature is discontinued, it will not even allow you to manually import a QFX file. The three different banks that I deal with only offer QFX format for downloading.

So my options are
(1) Manually enter transactions, or
(2) Upgrade to a newer version of Quicken, or
(3) Write a program that converts my QFX file to a QIF file so I can import it.

I chose option 3 using FreeBasic with iGUI.

Try this link to download it (scroll down to reply #14):
http://www.quickencommunity.com/webx?14@@.efd5c17/10
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: qfx2qif Quicken qfx to qif file converter

Postby AGS » Nov 22, 2008 19:26

jsherk wrote:Both QFX and QIF files are just text files, so all it really does is look for stuff in one file, reorder it, and stick it in the other file!!!

I used FBEdit for FreeBasic along with iGUI.

BACKGROUND:
I have been using Quicken XG 2005 on Windows 98 and Windows XP since it came out. As of Oct 2008, the Web Connect feature has been discontinued!

The only two formats that can be imported into Quicken 2005 are either QFX or QIF, but since the Web Connect feature is discontinued, it will not even allow you to manually import a QFX file. The three different banks that I deal with only offer QFX format for downloading.

So my options are
(1) Manually enter transactions, or
(2) Upgrade to a newer version of Quicken, or
(3) Write a program that converts my QFX file to a QIF file so I can import it.

I chose option 3 using FreeBasic with iGUI.

Try this link to download it (scroll down to reply #14):
http://www.quickencommunity.com/webx?14@@.efd5c17/10


This must be one of the first programs I've seen on this forum that deals with personal finance. I'm sure file conversion has been done before but not all that often. It would be nice to see what your program looks like. Are you planning to post the source on this forum?
jsherk
Posts: 82
Joined: Jun 09, 2006 22:40
Contact:

Postby jsherk » Nov 22, 2008 22:05

Here's the source... it probably won't win any awards though!!

Code: Select all

'QFX to QIF text file converter by Jeff Sherk Nov 2008
'Initially designed for Windows XP

'Note the direct paths to .bi files and lib files... you will need to change these!
#Define WIN_INCLUDEALL 'Need for filebroswer function
#include once "C:/FBEdit/Projects/qfx2qif/inc-lib/windows.bi" 'Need for filebroswer function
#include "C:/FBEdit/Projects/qfx2qif/inc-lib/file.bi" 'Need for file i/o read/write
#include "C:/FBEdit/Projects/qfx2qif/inc-lib/fbgfx.bi" 'Need for graphics mode
#include once "C:/FBEdit/Projects/qfx2qif/inc-lib/igui.bi" 'iGUI is the graphics interface I choose to use
#libpath "C:/FBEdit/Projects/qfx2qif/inc-lib/" 'Default path is freebasic/lib/win32
#inclib "igui" 'Make sure libigui.a is in the project folder. iGUI is the graphics interface I choose to use

'define iGUI variables
Dim Shared As igui.form_type form1, form2
Dim Shared As igui.button_type butQuit1, butBrowse, butImport, butQuit2, butMain
Dim Shared As igui.textbox_type boxImport

'define variables
Dim Shared As String Key, TRNTYPE(), DTPOSTED(), TRNAMT(), FITID(), trnNAME(), DTUSER(), getLine(), AcctType, newDate, commandLineArg
Dim Shared As String problem, version, workString, workString2, text(1 To 25), defaultFile

Dim Shared As Integer transNumber, textx(1 To 25), texty(1 To 25), textc(1 To 25), x, y, z, filenumber, cur_page
Dim Shared As Integer lineLen, maxLines, resultPut, resultOpen

Dim Shared As Boolean transaction, anykey

Screen 19,32,1,4 '19=800x600, 32=32-bit color depth, 1=1 page, 0=windowed 1=fullscreen 4=windowed(no maximize) NOTE that there is some kind of bug when you maximize the screen, so it's better to just disable it.
Color &HFFffffff, &HFF228b22 'white text on blue background
Cls
version = " -- QFX to QIF Converter v1.12 -- Nov 22/08 by Jeff Sherk --" 'by Jeff Sherk  Nov 2008
cur_page = 1
problem = ""
defaultFile = ""
anykey = FALSE


Function getfile(getfilename As string) As string
'This function is used to read each line from the QFX file (or any file) into it's own getLine(x) variable.
   filenumber = freefile 
   resultOpen = Open (getfilename, For input, As #filenumber)
   If resultOpen = 0 Then
      x = 1
      Do while Eof(filenumber) = 0
         ReDim Preserve getLine(x)
         Line Input #filenumber, getLine(x)
         x = x + 1
      Loop
      maxLines = x - 1
      Close #filenumber
   Else
      Color &HFFffffff, &HFFee3b3b 'white on red
      Print "ERROR: Could not open file for read: " + getfilename
      Color &HFFffffff, &HFF0000ff 'white on blue      
   EndIf
End Function

Function writeQIFfile(fileToOpen  As String, QIFfile As string) As String
'This function writes whatever data string is in 'QIFfile' to a text file called 'fileToOpen'.
   filenumber = FreeFile
   resultOpen = Open (fileToOpen, For Output, As #filenumber)
   If resultOpen = 0 Then
      resultPut = Put (#filenumber, ,QIFfile)
      If resultPut = 0 Then
         Color &HFFffff00, &HFF0000ff
         Print "DONE... Conversion and Export complete."
         Print "New file created: ";
         Color &HFFffff00, &HFF000000
         Print fileToOpen
         Color &HFFffffff, &HFF0000ff   
      Else
         Color &HFFffffff, &HFFee3b3b 'white on red
         Print "ERROR: Conversion failed."
         Print "File was opened, but could not write to it: " + fileToOpen
         Color &HFFffffff, &HFF0000ff 'white on blue
      EndIf
      Close #filenumber
   Else
      Color &HFFffffff, &HFFee3b3b 'white on red
      Print "ERROR: Conversion failed."
      Print "Could not open the file for write operation: " + fileToOpen
      Color &HFFffffff, &HFF0000ff 'white on blue
   EndIf
End Function

Function filebrowser (Byref ititle As String, Byref idir As String = Curdir) As String
'This function allows you to 'browse for' and 'choose' a file using the Windows filebrowser.
'I just copied and pasted this from elsewhere in the Freebasic forum... I have no clue how it works!
'KNOWN ISSUE: I can't figure out how to bring the FileBrowser window to the front... it alsways shows up behind my progra!
  Dim ofn As OPENFILENAME
  Dim filename As Zstring * (MAX_PATH + 1)
  Dim title As Zstring * 32 => ititle
  Dim initialdir As Zstring * 256 => idir

  With ofn
    .lStructSize       = Sizeof(OPENFILENAME)
    .hwndOwner         = NULL
    .hInstance         = GetModuleHandle(NULL)
                        'EXAMPLES of what else could go in the .lpstrFilter below:
                        '"All Files, (*.*)"
                        '"*.*"
                        '"Bas Files, (*.BAS)"
                        '"*.bas"
                        '"CSV Files, (*.csv)"
                        '"*.csv"
    .lpstrFilter       = Strptr(!"QFX Files, (*.qfx)\0*.qfx\0All Files, (*.*)\0*.*\0\0")
    .lpstrCustomFilter = NULL
    .nMaxCustFilter    = 0
    .nFilterIndex      = 1
    .lpstrFile         = @filename
    .nMaxFile          = Sizeof(filename)
    .lpstrFileTitle    = NULL
    .nMaxFileTitle     = 0
    .lpstrInitialDir   = @initialdir
    .lpstrTitle        = @title
    .Flags             = OFN_EXPLORER Or OFN_FILEMUSTEXIST Or OFN_PATHMUSTEXIST
    .nFileOffset       = 0
    .nFileExtension    = 0
    .lpstrDefExt       = NULL
    .lCustData         = 0
    .lpfnHook          = NULL
    .lpTemplateName    = NULL
  End With

  If (GetOpenFileName(@ofn) = FALSE) Then Return ""
  Return filename
End Function

Function cleartext As Integer
'This function clears and resets any text that was drawn on the screen.
'This is a workaround because iGUI didn't have away to draw text on the screen.
'Look for related workaround in the displayforms function (under Case 1)
' and in the 'Do While text(x)<>""' in the loop at the very bottom of the program.
   For x = 1 To 25
      text(x) = ""
      textx(x) = 10
      texty(x) = 100 + ((x-1)*30)
      textc(x) = &HFFffffff
   Next x
End Function

Function clearforms As Integer
'This function clears all the iGUI forms off the screen and then displays a message
' at the top of the screen (green message is good, red message means there is a problem)
   form1.set_visible 0

   If problem <> "" Then
      Color &HFFffffff, &HFFee3b3b 'white text on red background
      cls
      Print
      Print "PROBLEM: "; problem
      problem = ""
      beep
   else
      Color &HFFffffff, &HFF228b22 'white text on green background
      cls
      Print
      Print version;
   EndIf

End Function

Function displayforms As Integer
'This function displays and iGUI form on the main screen
   cls
   clearforms
   cleartext
   form1.set_visible 1
   boxImport.focus
   text(1) = "Choose the .QFX file you want to convert and hit the [CONVERT] button:"
   textx(1) = 10
   texty(1) = 100
   textc(1) = &HFFffff00
End Function

Sub iQuit_target
'This is what happens when you click the QUIT button.
   end
End Sub

Sub main_target
'This is what happens when you click the CHOOSE ANOTHER FILE button on the second screen
       anykey = FALSE
       displayforms
End Sub

Sub browse_target
'This is what happens when you click the BROWSE FOR FILE button
   boxImport.set_text filebrowser("Choose a QFX file...", "") 'You can specify a specific default directory by putting it in the empty quotes ie: "c:\" instead of ""
   boxImport.focus
End Sub

Sub import_target
'This is what happens when you click the CONVERT button
   If boxImport.get_text = "" Then 'Is there a filename specified?
      Color &HFFffffff, &HFFee3b3b
      cls
      Print
      Print "PROBLEM: You need to enter a filename!!"
      Beep
   ElseIf Right(boxImport.get_text,4) <> ".qfx" Then 'Is the filename have .qfx on the end?
      Color &HFFffffff, &HFFee3b3b
      cls
      Print
      Print "PROBLEM: You need to choose a .QFX text file."
      Beep
   ElseIf FileExists(boxImport.get_text) = 0 Then 'Does the filename you specified actually exist?
      Color &HFFffffff, &HFFee3b3b
      cls
      Print
      Print "PROBLEM: File does not exist, or cannot be accessed."
      Beep
   Else
      clearforms
      cleartext
      Color &HFFffffff, &HFF0000ff
      Cls
      Color &HFFffff00, &HFF0000ff
      Print "STARTING IMPORT... "
      Color &HFFffffff, &HFF0000ff
      Print "FILE: "+boxImport.get_text
      workString = getfile(boxImport.get_text)

      If problem = "" Then
         ReDim Preserve TRNTYPE(maxlines)
         ReDim Preserve DTPOSTED(maxlines)
         ReDim Preserve TRNAMT(maxlines)
         ReDim Preserve FITID(maxlines)
         ReDim Preserve trnNAME(maxlines)
         ReDim Preserve DTUSER(maxlines)
         Print "File contains"; maxLines; " line(s)."

         AcctType =""
         transaction = FALSE
         transNumber = 0
         For z = 1 To maxlines            
            'Need to clear the data... If you are converting more than one file and a field doesn't exist, it woould otherwise use data from previous file.
            DTPOSTED(z)=""
            TRNTYPE(z)=""
            trnNAME(z)=""
            DTUSER(z)=""
            TRNAMT(z)=""
            FITID(z)=""
            
            'This determines the Account Type from the QFX file. It only looks
            'for BANK and CCARD. It will default to CASH if it can't find either of the other two.
            If getLine(z) = "<BANKACCTFROM>" Then
               AcctType = "!Type:Bank"
               Print "Account Type set to: "+AcctType
            ElseIf getLine(z) = "<CCACCTFROM>" Then
               AcctType = "!Type:CCard"
               Print "Account Type set to: "+AcctType
            EndIf
            
            'This determines how many individual transactions are in the QFX file.
            If getLine(z) = "<STMTTRN>" Then
               transaction = TRUE
               transNumber = transNumber + 1
            elseIf getLine(z) = "</STMTTRN>" Then
               transaction = FALSE
            EndIf
            
            'This strips off the tags that were in the QFX file.
            If transaction = TRUE Then
               lineLen = Len(getLine(z))
               If Left(getLine(z),9) = "<TRNTYPE>" Then
                  TRNTYPE(transNumber) = Right(getLine(z),lineLen-9)
               elseIf Left(getLine(z),10) = "<DTPOSTED>" Then
                  DTPOSTED(transNumber) = Left(Right(getLine(z),lineLen-10),8)
               ElseIf Left(getLine(z),8) = "<TRNAMT>" Then
                  TRNAMT(transNumber) = Right(getLine(z),lineLen-8)
               elseIf Left(getLine(z),7) = "<FITID>" Then
                  FITID(transNumber) = Right(getLine(z),lineLen-7)
               elseIf Left(getLine(z),6) = "<NAME>" Then
                  trnNAME(transNumber) = Right(getLine(z),lineLen-6)
               ElseIf Left(getLine(z),8) = "<DTUSER>" Then
                  DTUSER(transNumber) = Right(getLine(z),lineLen-8)
               EndIf
            EndIf
         Next z
         If AcctType ="" Then 'Default account type to CASH because it didn't find BANK or CCARD
            AcctType ="!Type:Cash"
            Print "Account Type could NOT be determined... default type set to: "+AcctType
         EndIf
         
         Print "Imported " +Str(transnumber)+" transactions!"
         Print
         
         'QFX import completed, so now create/ouput the QIF file
         If transNumber >= 1 Then
            workString2 = AcctType
            
            'Go here for details on the QIF file format:  http://en.wikipedia.org/wiki/QIF
            For z = 1 To transNumber
               workString2 = workString2  +Chr$(13)+Chr$(10)+Chr$(13)+Chr$(10)
               
               'Convert date posted from YYYYYMMDD to MM/DD/YYYY and assign it to the D tag (date field)
               newDate = Mid(DTPOSTED(z),5,2)+"/"+Right(DTPOSTED(z),2)+"/"+Left(DTPOSTED(z),4)
               workString2 = workString2 + "D" + newDate +Chr$(13)+Chr$(10)
               
               'Assign transaction type to the N tag (check number or transaction type field)
               workString2 = workString2 + "N" + TRNTYPE(z) +Chr$(13)+Chr$(10)
               
               'Assign the payee name to the P tag (payee field)
               workString2 = workString2 + "P" + trnNAME(z) +Chr$(13)+Chr$(10)
               
               'If there was a transaction date, then add it in the M tag (memo field)
               If DTUSER(z) = "" Then
                  'workString2 = workString2 + "MID:" + FITID(z) +Chr$(13)+Chr$(10) 'Use this line to include the FITID tag
                  workString2 = workString2 + "M" +Chr$(13)+Chr$(10) 'Use this line to include the FITID tag
               Else
                  'workString2 = workString2 + "MTransactionDate:" + DTUSER(z) +"  ID:"+ FITID(z) +Chr$(13)+Chr$(10) 'Use this line to include the FITID tag
                  workString2 = workString2 + "MTransactionDate:" + DTUSER(z) +Chr$(13)+Chr$(10) 'Use this line to include the FITID tag
               EndIf
               
               'Assign the transaction amount to the T tag (amount field)
               workString2 = workString2 + "T" + TRNAMT(z) +Chr$(13)+Chr$(10)
               
               'Assign nothing to the L tag (category field)
               workString2 = workString2 + "L" +Chr$(13)+Chr$(10)
               
               'Assign CLEARED status to the C tag (blank, cleared or reconciled field)
               workString2 = workString2 + "CC" +Chr$(13)+Chr$(10)
               
               'Add a cavet ^ to indicate end of transaction
               workString2 = workString2 +Chr$(94)
            Next z
            
            'Go ahead and write the new QIF file.
            'The output file is put in the same directory as the input file, and just has .QIF added to it.
            'Example: Input File = "C:\mydata.qfx"   Output File = "C:\mydata.qfx.QIF"
            workString = writeQIFfile(boxImport.get_text+".QIF", workString2)
         Else
            'If it can't find any transactions in the input file, then abort the conversion.
            Color &HFFffffff, &HFFff0000
            Print "There were NO transactions to import... conversion aborted!!"
            Color &HFFffffff, &HFF0000ff
         EndIf
      Else
         'There was some kind of problem and the input file could not be imported.
         Print " "
         Color &HFFffffff, &HFFff0000
         Print "Error: Import was not succesful!"
         Color &HFFffffff, &HFF0000ff
      EndIf
      
      'Wait for a key press before going back to the main screen
      Print
       Print "Press any key to choose another file..."
      anykey = TRUE
   EndIf
End Sub

'Check out the docs in the freebasic forum on iGUI
igui.start

form1.register "--- Convert Quicken QFX file to QIF format ---", , , 0, 50, 800, 550, 1, 2
boxImport.register "File:", , , 10, 90, 780, 25, 0, 1, "", 1, 127
butBrowse.register "Browse for file", , , 55, 120, 135, 25, @browse_target, 1
butQuit1.register "QUIT", , , 10, 260, 75, 25, @iQuit_target, 1
butImport.register "CONVERT", , , 210, 120, 75, 25, @import_target, 1
form1.set_text_alignment 1

form2.register "", , , 0, 300, 800, 45, 1, 0
butQuit2.register "QUIT", , , 10, 10, 75, 25, @iQuit_target, 1
butMain.register "CHOOSE ANOTHER FILE", , , 95, 10, 200, 25, @main_target, 1
form2.set_text_alignment 1

'Set the various colors....
igui.vars.misc.colorscheme.form_back = &HFF0000ff 'blue
igui.vars.misc.colorscheme.object_back = &HFF000000 'black
igui.vars.misc.colorscheme.object_disabled = &HFF778899 'grey
igui.vars.misc.colorscheme.object_hover = &HFF228B22 'green
igui.vars.misc.colorscheme.object_mousedown = &HFF0000ff 'blue
igui.vars.misc.colorscheme.text = &HFFffffff 'white
igui.vars.misc.colorscheme.text_disabled = &HFFee3b3b 'red
igui.vars.misc.colorscheme.text_selected = &HFF777777 'dark grey
igui.vars.misc.colorscheme.text_entrytext = &HFF000066 'dark blue
igui.vars.misc.colorscheme.tooltip = &HFF66cdaa 'light grey

form1.focus
clearforms
cleartext
displayforms

'See if a filename was passed as a command line argument
'You can use this program from the commandline with a filename and path, which will appear in the FILE box.
'If nothing is specified it will be left blank.
'Ex: qfx2qif.exe "C:\myfile.qfx"
'You can actually put anything you want in the quotes, and it will appear in the FILE box... there
' is no checking on this argument. The FILE box is not checked until you click the CONVER button.
commandLineArg = Command(1)
If Len(commandLineArg) > 0 Then
   boxImport.set_text commandLineArg
EndIf

'MAIN PROGRAM LOOP
Do
   ScreenLock
   
   igui.process Key 'iGUI checks for button presses here
   igui.display 'iGUI displays it's forms on the screen here
   
   'Check the Cleartext Function for a little more on this IF statement.
   'This is a workaround to draw text on the screen beacuse iGUI didn't support that feature.
   If text(1) <> "" Then
      x = 1
      Do While text(x) <> ""
         draw String (textx(x),texty(x)), text(x), textc(x)   
         x = x + 1
         If x > 25 Then Exit do
      loop
   EndIf
   
   screenunlock
   
   Sleep 20 'This just waits and does nothing until a key is pressed, which means LOW CPU usage!!!
   
   key = Inkey$ 'What key was pressed?
   
   'This will check for exit commands to close window/program.
   'Valid ways to exit the program are to hit the QUIT button, hit the 'red x' in the top right corner
   ' of the window, hit CTRL+Q or hit CTRL+X
   If Len(key) = 1 Then
    If key = Chr$(17) Or key = Chr$(24) Then Exit Do '24=CTRL+Q or 17=CTRL+X
    If anykey = TRUE And Key <> "" Then 'Press anykey to return to the main screen from the second key
       anykey = FALSE
       displayforms
       Key = ""
    EndIf
   ElseIf Len(key) = 2 Then 'Need to check for double length key strings in order to find out if the 'red x' was clicked.
    If Left(key,1) = Chr$(255) And Right(key,1) = Chr$(107) Then Exit Do '255&107=Clicked the Red X on window to exit .
   End If
Loop

End
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Postby AGS » Nov 26, 2008 20:55

Thanks for the source code. I never knew about this file format (QIF) yet it seems to be the format to use for financial packages. I just found out The bank I'm with supports QIF as well.

Most helpful, this project of yours, jsherk. An eye - opener for me anyways. It makes sense to use the PC as an aid to manage my financial stuff.
jsherk
Posts: 82
Joined: Jun 09, 2006 22:40
Contact:

Postby jsherk » Nov 26, 2008 21:15

QIF is an older text format (I think specific to Quicken). The newer Quicken format is QFX, which is almost identical to the OFX format. QFX/OFX (both text files) contain more details about each transaction than QIF, and QIF is no longer used by Quicken, but in my older 2005 version only supports QIF so I it was either buy a new version of Quicken, move to GnuCash, or write this little utility!
jsherk
Posts: 82
Joined: Jun 09, 2006 22:40
Contact:

Postby jsherk » Jan 11, 2009 18:02

I've uploaded my converter (.exe) here:
http://uploading.com/files/VXZ3E5B4/qfx2qif.exe.html
geoffgow
Posts: 1
Joined: May 01, 2009 18:37

QFX - 2 - QIF converter

Postby geoffgow » May 01, 2009 18:42

Hello - thanks for making your work available. However I'm not able to get it to work. It returns an error saying that the "Account type could NOT be determined .... default type set to !Type:Cash" Imported 0 transactions ....

Any thoughts what's up?

Thanks - Geoff
geoffgow@yahoo.com
jsherk
Posts: 82
Joined: Jun 09, 2006 22:40
Contact:

Postby jsherk » May 01, 2009 18:54

I'll send you a private email and if you can send me your QFX file I'll take a look at it.
jsherk
Posts: 82
Joined: Jun 09, 2006 22:40
Contact:

Postby jsherk » May 02, 2009 14:01

I got your email with your qfx file, and I also got your email saying you found a dos program that does the conversion and works.

I looked at your qfx file, and figured out that my program does NOT take into account any spaces in front of the lines (a bug in my program). Your qfx file was formated with spaces in front of some lines. I used PSPAD free text editor and choose EDIT->REMOVE REDUNDANT SPACES and then ran my converter on your file and it worked fine.

I don't have to time to fix the bug in my program right now, but at least there is a work around if you really want to use it.

EXAMPLE: This does NOT work because of spaces at beginning of line:

Code: Select all

 <STMTTRN>
   <TRNTYPE>DEBIT
   <DTPOSTED>20080607170000.000
   <TRNAMT>-383.23
   <FITID>200806101135183
   <NAME>MY INSURANCE CO 800-888-8888
   <MEMO>380: MY INSURANCE CO 800-888-8888
 </STMTTRN>


EXAMPLE: This WILL work (no spaces):

Code: Select all

<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20080607170000.000
<TRNAMT>-383.23
<FITID>200806101135183
<NAME>MY INSURANCE CO 800-888-8888
<MEMO>380: MY INSURANCE CO 800-888-8888
</STMTTRN>
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Postby Merick » May 02, 2009 14:29

I can't compile it because I don't have the igui library, but you can probably fix the problem by using instr:

If getLine(z) = "<BANKACCTFROM>" Then

becomes

If InStr (getLine(z), "<BANKACCTFROM>") Then

etc...
jsherk
Posts: 82
Joined: Jun 09, 2006 22:40
Contact:

Postby jsherk » May 02, 2009 15:44

Thanks Merick... that only solves the "Account Type" problem.

The other lines that actually pull the data out of the file look like this:

Code: Select all

If Left(getLine(z),9) = "<TRNTYPE>" Then
   TRNTYPE(transNumber) = Right(getLine(z),lineLen-9)


Notice that it is specifically looking to see if <TRNTYPE> is the first 9 characters, and if it is, it chops those first 9 characters off to get the actual data.

Probably the easiest method is to just add a function called RemoveSpaces(). I would then call it right after this line:
For z = 1 To maxlines
and it would remove any spaces from the beginning of getLine(z), then return getLine(z) without the spaces, and no other code would need to be modified.
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Postby Merick » May 02, 2009 16:08

yah, that would probably be easiest, but something like this should also work:

pos = instr (getline(z), "<TRNTYPE>")
if pos > 0 then TRNTYPE(transNumber) = Mid (getLine(z), pos+9)
Imortis
Moderator
Posts: 1605
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Postby Imortis » May 03, 2009 0:40

You could always LTRIM each line before processing it. It doesn't need the whitespace does it?
nlbngr
Posts: 1
Joined: Mar 27, 2010 16:12

Re: qfx2qif Quicken qfx to qif file converter

Postby nlbngr » Mar 27, 2010 16:42

jsherk wrote:
I chose option 3 using FreeBasic with iGUI.

Try this link to download it (scroll down to reply #14):
http://www.quickencommunity.com/webx?14@@.efd5c17/10



I, myself am in the same type of situation of trying to convert QFX to QIF. I've tried your program and the redundant space fix as you've explained it. Unfortunately, I'm still getting the same results as the other member.

I suspect that I'm missing a very simple under-riding concept here. Perhaps I'm supposed to have 'Free basic' installed somewhere or perhaps my file that I'm trying to convert needs to be in one specific place. I notice from your code script, that a "#libpath" is designated. Should I have set something up for that?

Pardon my ignorance. Any help would be appreciated.
Briago
Posts: 2
Joined: Mar 04, 2011 0:13

Simple VB program for this.

Postby Briago » Mar 04, 2011 0:20

Some of you may be interested in making the program yourself for the experience. For anyone else, the link below has the program I wrote for myself.

There is no user interface or installer. You just drop the QFX on the executable and a QIF appears in the same directory.

I associate QFX files with the executable (stored in program files). Then when I double click any QFX file a QIF appears next to it. I don't think conversion can be easier.

If you run the executable it will come up with instructions for associating the QFX file with the program.

http://software.moering.net/

This is a very simple VB program (like I said, not even a UI). I'm currently working to get it posted to downloads.com for others to use.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 5 guests