qif 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v1.1.1 Ruby 1.9 support. [jemmyw, allolex]
2
+
1
3
  v1.1.0 Added block version of new method to writer and error checking on
2
4
  files. [elmatou]
3
5
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  === DOCUMENTATION:
10
10
 
11
- * http://rdoc.info/gems/qif/0.2/frames
11
+ * http://rdoc.info/github/jemmyw/Qif/master/frames
12
12
 
13
13
  === EXAMPLE:
14
14
 
@@ -18,6 +18,35 @@
18
18
  puts [transaction.name, transaction.description, transaction.amount].join(", ")
19
19
  end
20
20
 
21
+ === CSV conversion example
22
+
23
+ # Ruby 1.9.2
24
+ require 'csv'
25
+ require 'qif'
26
+
27
+ # file.csv is the source
28
+ # [0] Date in dd/mm/yyyy,
29
+ # [1] memo field,
30
+ # [2] payee,
31
+ # [3] debit amount,
32
+ # [4] credit amount
33
+ # Ignore other fields
34
+ basefile = 'file'
35
+ bank_input = CSV.read("#{file}.csv")
36
+
37
+ Qif::Writer.open("#{file}.qif", type = 'Bank', format = 'dd/mm/yyyy') do |qif|
38
+ bank_input.each do |row|
39
+ # Fix the values depending on what state your CSV data is in
40
+ row.each { |value| value.to_s.gsub!(/^\s+|\s+$/,'') }
41
+ qif << Qif::Transaction.new(
42
+ :date => row[0],
43
+ :amount => row[3].empty? ? row[4].to_f : -row[3].to_f,
44
+ :memo => row[1],
45
+ :payee => row[2]
46
+ )
47
+ end
48
+ end
49
+
21
50
  === LICENSE:
22
51
 
23
52
  Copyright (c) 2010 Jeremy Wells
@@ -13,7 +13,19 @@ module Qif
13
13
  order = date_order
14
14
 
15
15
  if match = regex.match(date)
16
- Time.mktime(*%w(y m d).map{|t| match[order.index(t) + 1].to_i })
16
+ year = match[order.index('y')+1].to_i
17
+
18
+ if year < 100
19
+ start_year = Time.now.year - 50
20
+ start_cent = (start_year/100).to_i*100
21
+ if year > start_year-start_cent
22
+ year += start_cent
23
+ else
24
+ year += ((Time.now.year/100).to_i*100)
25
+ end
26
+ end
27
+
28
+ Time.mktime(year, *%w(m d).map{|t| match[order.index(t) + 1].to_i })
17
29
  end
18
30
  end
19
31
 
@@ -41,7 +41,7 @@ module Qif
41
41
  def to_s(format = 'dd/mm/yyyy')
42
42
  SUPPORTED_FIELDS.collect do |k,v|
43
43
  next unless current = instance_variable_get("@#{k}")
44
- field = v.keys
44
+ field = v.keys.first
45
45
  case current.class.to_s
46
46
  when "Time", "Date", "DateTime"
47
47
  "#{field}#{DateFormat.new(format).format(current)}"
@@ -1,15 +1,19 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Qif::DateFormat do
4
4
  it 'should work with 2 digit years in mm/dd/yy format' do
5
5
  reader = Qif::DateFormat.new('mm/dd/yy')
6
6
  time = reader.parse('09/28/10')
7
7
  time.should == Time.mktime(2010, 9, 28)
8
+ time = reader.parse('09/28/94')
9
+ time.should == Time.mktime(1994, 9, 28)
8
10
  end
9
11
 
10
12
  it 'should work with 2 digit years in dd/mm/yy format' do
11
13
  reader = Qif::DateFormat.new('dd/mm/yy')
12
14
  time = reader.parse('28/09/10')
13
15
  time.should == Time.mktime(2010, 9, 28)
16
+ time = reader.parse('28/09/94')
17
+ time.should == Time.mktime(1994, 9, 28)
14
18
  end
15
- end
19
+ end
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  shared_examples_for "3 record files" do
4
4
  it 'should have 3 records' do
@@ -1,10 +1,10 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Qif::Transaction do
4
4
  describe '::read' do
5
5
  it 'should return a new transaction with all attributes set' do
6
6
  t = Qif::Transaction.read(
7
- 'D' => Time.parse('06/ 1/94'),
7
+ 'D' => Time.parse('1994-06-01'),
8
8
  'T' => '-1000.00'.to_f,
9
9
  'C' => 'X',
10
10
  'N' => '1005',
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
  require 'stringio'
3
3
 
4
4
  describe Qif::Writer do
metadata CHANGED
@@ -1,31 +1,32 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: qif
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 0
10
- version: 1.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jeremy Wells
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-03-07 00:00:00 +13:00
19
- default_executable:
20
- dependencies: []
21
-
12
+ date: 2011-03-07 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &70212876609680 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 2.5.0
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70212876609680
22
25
  description: A library for reading and writing quicken QIF files.
23
26
  email: jemmyw@gmail.com
24
27
  executables: []
25
-
26
28
  extensions: []
27
-
28
- extra_rdoc_files:
29
+ extra_rdoc_files:
29
30
  - CHANGELOG
30
31
  - LICENSE
31
32
  - README.rdoc
@@ -34,18 +35,16 @@ extra_rdoc_files:
34
35
  - lib/qif/reader.rb
35
36
  - lib/qif/transaction.rb
36
37
  - lib/qif/writer.rb
37
- files:
38
- - CHANGELOG
39
- - LICENSE
40
- - Manifest
41
- - QIF_references
38
+ files:
42
39
  - README.rdoc
40
+ - LICENSE
41
+ - CHANGELOG
43
42
  - Rakefile
44
- - lib/qif.rb
45
43
  - lib/qif/date_format.rb
46
44
  - lib/qif/reader.rb
47
45
  - lib/qif/transaction.rb
48
46
  - lib/qif/writer.rb
47
+ - lib/qif.rb
49
48
  - spec/fixtures/3_records_ddmmyy.qif
50
49
  - spec/fixtures/3_records_ddmmyyyy.qif
51
50
  - spec/fixtures/3_records_dmyy.qif
@@ -62,46 +61,34 @@ files:
62
61
  - spec/lib/writer_spec.rb
63
62
  - spec/spec.opts
64
63
  - spec/spec_helper.rb
65
- - qif.gemspec
66
- has_rdoc: true
67
- homepage: http://qif.github.com/qif/
64
+ homepage: http://qif.github.com/qif
68
65
  licenses: []
69
-
70
66
  post_install_message:
71
- rdoc_options:
67
+ rdoc_options:
72
68
  - --line-numbers
73
69
  - --inline-source
74
70
  - --title
75
71
  - Qif
76
72
  - --main
77
73
  - README.rdoc
78
- require_paths:
74
+ require_paths:
79
75
  - lib
80
- required_ruby_version: !ruby/object:Gem::Requirement
76
+ required_ruby_version: !ruby/object:Gem::Requirement
81
77
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
89
- required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
83
  none: false
91
- requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- hash: 11
95
- segments:
96
- - 1
97
- - 2
98
- version: "1.2"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '1.2'
99
88
  requirements: []
100
-
101
89
  rubyforge_project: qif
102
- rubygems_version: 1.6.1
90
+ rubygems_version: 1.8.6
103
91
  signing_key:
104
92
  specification_version: 3
105
93
  summary: A library for reading and writing quicken QIF files.
106
94
  test_files: []
107
-
data/Manifest DELETED
@@ -1,27 +0,0 @@
1
- CHANGELOG
2
- LICENSE
3
- Manifest
4
- QIF_references
5
- README.rdoc
6
- Rakefile
7
- lib/qif.rb
8
- lib/qif/date_format.rb
9
- lib/qif/reader.rb
10
- lib/qif/transaction.rb
11
- lib/qif/writer.rb
12
- spec/fixtures/3_records_ddmmyy.qif
13
- spec/fixtures/3_records_ddmmyyyy.qif
14
- spec/fixtures/3_records_dmyy.qif
15
- spec/fixtures/3_records_invalid_header.qif
16
- spec/fixtures/3_records_mmddyy.qif
17
- spec/fixtures/3_records_mmddyyyy.qif
18
- spec/fixtures/3_records_separator.qif
19
- spec/fixtures/not_a_QIF_file.txt
20
- spec/fixtures/quicken_investment_account.qif
21
- spec/fixtures/quicken_non_investement_account.qif
22
- spec/lib/date_format_spec.rb
23
- spec/lib/reader_spec.rb
24
- spec/lib/transaction_spec.rb
25
- spec/lib/writer_spec.rb
26
- spec/spec.opts
27
- spec/spec_helper.rb
@@ -1,728 +0,0 @@
1
- Have to check : http://cpansearch.perl.org/src/MMCGILLIS/Finance-QIF-2.04/lib/Finance/QIF.pm
2
-
3
-
4
- Source : http://web.intuit.com/support/quicken/docs/d_qif.html
5
- Quicken Interchange Format (QIF) files
6
-
7
- The Quicken interchange format (QIF) is a specially formatted text (ASCII) file that enables Quicken transactions to be moved from one Quicken account register into another Quicken account register, or to or from other programs that support the QIF format.
8
-
9
- Note: For Quicken to translate data from a text file into the Quicken register as transactions, the text file must be in the QIF format.
10
-
11
- Required File Formatting
12
-
13
- Each transaction must end with a symbol, indicating the end of entry. Each item in the transaction must display on a separate line. When Quicken exports an account register or list, it adds a line to the top of the file that identifies the type of account or list. Listed below are the header lines Quicken adds to the exported files:
14
-
15
- Header Type of data
16
- !Type:Bank Bank account transactions
17
- !Type:Cash Cash account transactions
18
- !Type:CCard Credit card account transactions
19
- !Type:Invst Investment account transactions
20
- !Type:Oth A Asset account transactions
21
- !Type:Oth L Liability account transactions
22
- !Account Account list or which account follows
23
- !Type:Cat Category list
24
- !Type:Class Class list
25
- !Type:Memorized Memorized transaction list
26
-
27
- Quicken can be configured to import all transfers, regardless of whether Ignore Transfers is selected when the file is imported. To do this, add a line to the file being imported into the Quicken account. Use a text editor or word processor to put the following line immediately after the header line at the top of the file:
28
-
29
- !Option:AllXfr
30
-
31
-
32
- Items for Non-Investment Accounts
33
- Each item in a bank, cash, credit card, other liability, or other asset account must begin with a letter that indicates the field in the Quicken
34
- register. The non-split items can be in any sequence:
35
-
36
- Field Indicator Explanations
37
- D Date
38
- T Amount
39
- C Cleared status
40
- N Num (check or reference number)
41
- P Payee
42
- M Memo
43
- A Address (up to five lines; the sixth line is an optional message)
44
- L Category (Category/Subcategory/Transfer/Class)
45
- S Category in split (Category/Transfer/Class)
46
- E Memo in split
47
- $ Dollar amount of split
48
- ^ End of entry
49
- Note: Repeat the S, E, and $ lines as many times as needed for additional items in a split. If an item is omitted from the transaction in the QIF file, Quicken treats it as a blank item.
50
-
51
-
52
- Items for Investment Accounts
53
- Field Indicator Explanation
54
- D Date
55
- N Action
56
- Y Security
57
- I Price
58
- Q Quantity (number of shares or split ratio)
59
- T Transaction amount
60
- C Cleared status
61
- P Text in the first line for transfers and reminders
62
- M Memo
63
- O Commission
64
- L Account for the transfer
65
- $ Amount transferred
66
- ^ End of entry
67
-
68
-
69
- Items for Account Information
70
- The account header !Account is used in two places, at the start of an account list and the start of a list of transactions to specify to which account they belong.
71
- Field Indicator Explanation
72
- N Name
73
- T Type of account
74
- D Description
75
- L Credit limit (only for credit card account)
76
- / Statement balance date
77
- $ Statement balance
78
- ^ End of entry
79
-
80
-
81
- Items for a Category List
82
- Field Indicator Explanation
83
- N Category name:subcategory name
84
- D Description
85
- T Tax related if included, not tax related if omitted
86
- I Income category
87
- E Expense category (if category is unspecified, Quicken assumes expense type)
88
- B Budget amount (only in a Budget Amounts QIF file)
89
- R Tax schedule information
90
- ^ End of entry
91
-
92
-
93
- Items for a Class List
94
- Field Indicator Explanation
95
- N Class name
96
- D Description
97
- ^ End of entry
98
-
99
- Items for a Memorized Transaction List
100
-
101
- Immediately preceding the ^ character, each entry must end with one of the following file indicators to specify the transaction type.
102
- KC, KD, KP, KI, KE
103
-
104
- With that exception, memorized transaction entries have the same format as regular transaction entries (non-investment accounts). However, the Date or Num field is included. All items are optional, but if an amortization record is included, all seven amortization lines must also be included.
105
-
106
- Field Indicator Explanation
107
- KC Check transaction
108
- KD Deposit transaction
109
- KP Payment transaction
110
- KI Investment transaction
111
- KE Electronic payee transaction
112
- T Amount
113
- C Cleared status
114
- P Payee
115
- M Memo
116
- A Address
117
- L Category or Transfer/Class
118
- S Category/class in split
119
- E Memo in split
120
- $ Dollar amount of split
121
- 1 Amortization: First payment date
122
- 2 Amortization: Total years for loan
123
- 3 Amortization: Number of payments already made
124
- 4 Amortization: Number of periods per year
125
- 5 Amortization: Interest rate
126
- 6 Amortization: Current loan balance
127
- 7 Amortization: Original loan amount
128
- ^ End of entry
129
-
130
-
131
- Examples of QIF files
132
-
133
- Normal Transactions Example
134
- Transaction Item Comment (not in file)
135
- !Type:Bank Header
136
- D6/ 1/94 Date
137
- T-1,000.00 Amount
138
- N1005 Check number
139
- PBank Of Mortgage Payee
140
- L[linda] Category
141
- S[linda] First category in split
142
- $-253.64 First amount in split
143
- SMort Int Second category in split
144
- $=746.36 Second amount in split
145
- ^ End of transaction
146
- D6/ 2/94 Date
147
- T75.00 Amount
148
- PDeposit Payee
149
- ^ End of transaction
150
- D6/ 3/94 Date
151
- T-10.00 Amount
152
- PAnthony Hopkins Payee
153
- MFilm Memo
154
- LEntertain Category
155
- AP.O. Box 27027 Address (line 1)
156
- ATucson, AZ Address (line 2)
157
- A85726 Address (line 3)
158
- A Address (line 4)
159
- A Address (line 5)
160
- A Address (line 6)
161
- ^ End of transaction
162
-
163
- Investment Example
164
- Transaction Item Comment (not in file)
165
- !Type:Invst Header line
166
- D8/25/93 Date
167
- NShrsIn Action (optional)
168
- Yibm4 Security
169
- I11.260 Price
170
- Q88.81 Quantity
171
- CX Cleared status
172
- T1,000.00 Amount
173
- MOpening Balance Memo
174
- ^ End of transaction
175
- D8/25/93 Date
176
- NBuyX Action
177
- Yibm4 Security
178
- I11.030 Price
179
- Q9.066 Quantity
180
- T100.00 Amount
181
- MEst. price as of 8/25/93 Memo
182
- L[CHECKING] Account for transfer
183
- $100.00 Amount transferred
184
- ^ End of transaction
185
-
186
- Memorized List Example
187
- Transaction Item Comment (not in file)
188
- !Type:Memorized Header line
189
- T-50.00 Amount
190
- POakwood Gardens Payee
191
- MRent Memo
192
- KC Check transaction
193
- ^ End of transaction
194
-
195
-
196
- Source :http://www.beansmart.com/quicken/Converting-Fidelity-CVS-to-QIF-or-OFX-for-Quicken-2007-5296-1.htm
197
-
198
- Collected over the years:
199
-
200
- QUICKEN INTERCHANGE FORMAT (QIF)
201
-
202
- Overview
203
- You can export transactions from a Quicken account register to a
204
- specially formatted text file and import data to a Quicken register
205
- from the same type of text file. This text file MUST be formatted
206
- as a Quicken Interchange Format (QIF) file. For Quicken to
207
- translate data from a text file into the Quicken register as
208
- transactions, the data must be in the QIF format.
209
-
210
- Procedure
211
- Basic Procedures:
212
- * Each transaction must end with a * symbol
213
- * Each item in the transaction must appear on a separate line
214
- * When Quicken exports an account register, it adds a line at the
215
- top of the file that identifies the type of account. Here are
216
- the header lines Quicken adds to the exported files:
217
-
218
- !Type:Bank
219
- !Type:Cash
220
- !Type:CCard
221
- !Type:Invst
222
- !Type:Oth A
223
- !Type:Oth L
224
-
225
- * You can add a line to a file to be imported into Quicken account
226
- to force Quicken to import all transfers, regardless of whether
227
- Ignore Transfers is selected when the file is imported. Use a
228
- test editor or word processor to put the following line right
229
- after the header line at the top of the file:
230
-
231
- !Option:AllXfr
232
-
233
-
234
- Items for non-investment accounts
235
-
236
- Each item in a bank, cash, credit card, other liability, or other
237
- asset account must begin with a letter that indicates the field in
238
- the Quicken register. The non-split items can be in any sequence:
239
-
240
- D Date
241
- T Amount
242
- C Cleared status
243
- N Number(check or reference number)
244
- P Payee
245
- A Address (up to five lines; the sixth line is an optional
246
- message)
247
- L Category (Category/Subcategory/Transfer/Class
248
- S Category in split (Category/Transfer/Class)
249
- E Memo in split
250
- $ Dollar amount of split
251
- ^ End of the entry
252
-
253
- Items for investment accounts
254
- D Date
255
- N Action
256
- Y Security
257
- I Price
258
- Q Quantity (Number of shares or split ratio)
259
- C Cleared Status
260
- P. Text in the first line for transfers and reminders
261
- M Memo
262
- O Commission
263
- L Account for the transfer
264
- $ Amount transferred
265
- ^ End of the entry
266
-
267
- Repeat the S, E, and $ lines as many times as needed for additional
268
- items in a split. If an item is omitted from the transaction in the
269
- QIF file, Quicken treats it as a blank item.
270
-
271
-
272
-
273
- Examples of QIF files
274
-
275
- Transaction Item Comment (not in file)
276
- !Type:Bank Header line
277
- D7/8/93 Date
278
- T-1000.0 Transaction amount
279
- CX Status in Cleared column
280
- N255 Check Number
281
- PFranks Plumbing Payee
282
- AFranks Plumbing Address (first line)
283
- A1234 Main St. Address (second line)
284
- ASan Jose, CA 95123 Address (third line)
285
- LHome Maint Category/Subcategory/Transfer/Class
286
- ^ End of the transaction
287
- D7/8/93 Date
288
- T-75.46 Transaction amount
289
- CX Status in Cleared column
290
- N256 Check Number
291
- PWalts Drug Payee
292
- LSupplies First Category/Subcategory/Class in
293
- the split
294
- EOffices Supplies First memo in the split
295
- $-51.00 First amount in the split
296
- SMedicine Second Category/Subcategory/Class in the
297
- split
298
- EPrescription Drugs Second memo in the split
299
- $-24.46 Second amount in the split
300
- ^ End of the transaction
301
-
302
- Transaction Item Comment (not in file)
303
- !Type:Bank Header line
304
- D8/25/93 Date
305
- NShrsIn Action (optional)
306
- Yibm4 Security
307
- I11.260 Price
308
- Q88.81 Quantity
309
- CX Cleared Status
310
- T1,000.00 Amount
311
- MOpening Balance Memo
312
- ^ End of the transaction
313
- D8/25/93 Date
314
- NBuyX Action
315
- Yibm4 Security
316
- I11.030 Price
317
- Q9.066 Quantity
318
- T100.00 Amount
319
- MEst. price as of 8/25/93
320
- Memo
321
- L[CHECKING] Account for transfer
322
- $100.00 Amount transferred
323
- ^ End of the transaction
324
-
325
- At Intuit, we highly recommend that you backup your Quicken data
326
- regularly to protect against loss due to unexpected power failures,
327
- diskette damage or other mishaps. If you need further assistance,
328
- you may contact Intuit Technical Support at (415) 858-6050, Monday
329
- through Friday between 5 am and 5 pm Pacific time.
330
-
331
- --- Another entry of this info ---
332
- Export headers for QIF files
333
-
334
- Export headers in QIF files divide separate groups of items such
335
- as accounts or transactions. They can also signify options. Export
336
- headers follow the general format:
337
-
338
- !<Header name>:<Export type>
339
-
340
- Exportable accounts
341
-
342
- The table below lists the types of accounts that can be exported
343
- and their export headers:
344
-
345
- Export Header Type of account
346
- !Type:Bank Bank account
347
- !Type:Cash Cash account
348
- !Type:CCard Credit card account
349
- !Type:Invst Investment account
350
- !Type:Oth A Asset account
351
- !Type:Oth L Liability account
352
- !Type:Invoice Invoice account (business subtype of Oth A)
353
- !Type:Tax Tax account (business subtype of Oth L)
354
- !Type:Bill Bill account (business subtype of Oth L)
355
- An account header is followed by transaction records if there are
356
- any within the selected date range.
357
-
358
- Exportable lists
359
-
360
- The table below lists the types of lists that can be exported and
361
- their export headers:
362
-
363
- Export Header Type of list
364
- !Type:Class Class list
365
- !Type:Cat Category list
366
- !Type:Memorized Memorized transactions list
367
- !Type:Security Securities list
368
- !Type:Prices Security Prices list
369
- !Type:Budget Budgets list
370
- !Type:Invitem Invoice items list
371
- !Type:Template Business templates list
372
- A list header is followed by records of the selected list type.
373
-
374
- Options headers
375
-
376
- Below is the option you can use, and its action:
377
-
378
- Export Header Meaning
379
- !Option:AllXfr Forces transfers to be imported, even if Ignore
380
- Transfers is set.
381
- Account headers
382
-
383
- Export Header Meaning
384
- !Option:AutoSwitch Start of the Accounts list
385
- !Account Beginning of accounts list records
386
- !Clear:AutoSwitch End of the Accounts list
387
- !Account is followed by either a list of account records for the
388
- Accounts list or a single account record for the selected account
389
- transactions.
390
-
391
- Copyright (c) 1999 Intuit, Inc.
392
-
393
-
394
-
395
- Identifiers for non-investment accounts
396
-
397
- Use these letters to identify specific items in a non-investment
398
- 430 No such article
399
- Howard Kaikow wrote:
400
-
401
- Collected over the years:
402
-
403
- QUICKEN INTERCHANGE FORMAT (QIF)
404
-
405
- Overview
406
- You can export transactions from a Quicken account register to a
407
- specially formatted text file and import data to a Quicken register
408
- from the same type of text file. This text file MUST be formatted
409
- as a Quicken Interchange Format (QIF) file. For Quicken to
410
- translate data from a text file into the Quicken register as
411
- transactions, the data must be in the QIF format.
412
-
413
- Procedure
414
- Basic Procedures:
415
- * Each transaction must end with a * symbol
416
- * Each item in the transaction must appear on a separate line
417
- * When Quicken exports an account register, it adds a line at the
418
- top of the file that identifies the type of account. Here are
419
- the header lines Quicken adds to the exported files:
420
-
421
- !Type:Bank
422
- !Type:Cash
423
- !Type:CCard
424
- !Type:Invst
425
- !Type:Oth A
426
- !Type:Oth L
427
-
428
- * You can add a line to a file to be imported into Quicken account
429
- to force Quicken to import all transfers, regardless of whether
430
- Ignore Transfers is selected when the file is imported. Use a
431
- test editor or word processor to put the following line right
432
- after the header line at the top of the file:
433
-
434
- !Option:AllXfr
435
-
436
-
437
- Items for non-investment accounts
438
-
439
- Each item in a bank, cash, credit card, other liability, or other
440
- asset account must begin with a letter that indicates the field in
441
- the Quicken register. The non-split items can be in any sequence:
442
-
443
- D Date
444
- T Amount
445
- C Cleared status
446
- N Number(check or reference number)
447
- P Payee
448
- A Address (up to five lines; the sixth line is an optional
449
- message)
450
- L Category (Category/Subcategory/Transfer/Class
451
- S Category in split (Category/Transfer/Class)
452
- E Memo in split
453
- $ Dollar amount of split
454
- ^ End of the entry
455
-
456
- Items for investment accounts
457
- D Date
458
- N Action
459
- Y Security
460
- I Price
461
- Q Quantity (Number of shares or split ratio)
462
- C Cleared Status
463
- P. Text in the first line for transfers and reminders
464
- M Memo
465
- O Commission
466
- L Account for the transfer
467
- $ Amount transferred
468
- ^ End of the entry
469
-
470
- Repeat the S, E, and $ lines as many times as needed for additional
471
- items in a split. If an item is omitted from the transaction in the
472
- QIF file, Quicken treats it as a blank item.
473
-
474
-
475
-
476
- Examples of QIF files
477
-
478
- Transaction Item Comment (not in file)
479
- !Type:Bank Header line
480
- D7/8/93 Date
481
- T-1000.0 Transaction amount
482
- CX Status in Cleared column
483
- N255 Check Number
484
- PFranks Plumbing Payee
485
- AFranks Plumbing Address (first line)
486
- A1234 Main St. Address (second line)
487
- ASan Jose, CA 95123 Address (third line)
488
- LHome Maint Category/Subcategory/Transfer/Class
489
- ^ End of the transaction
490
- D7/8/93 Date
491
- T-75.46 Transaction amount
492
- CX Status in Cleared column
493
- N256 Check Number
494
- PWalts Drug Payee
495
- LSupplies First Category/Subcategory/Class in
496
- the split
497
- EOffices Supplies First memo in the split
498
- $-51.00 First amount in the split
499
- SMedicine Second Category/Subcategory/Class in the
500
- split
501
- EPrescription Drugs Second memo in the split
502
- $-24.46 Second amount in the split
503
- ^ End of the transaction
504
-
505
- Transaction Item Comment (not in file)
506
- !Type:Bank Header line
507
- D8/25/93 Date
508
- NShrsIn Action (optional)
509
- Yibm4 Security
510
- I11.260 Price
511
- Q88.81 Quantity
512
- CX Cleared Status
513
- T1,000.00 Amount
514
- MOpening Balance Memo
515
- ^ End of the transaction
516
- D8/25/93 Date
517
- NBuyX Action
518
- Yibm4 Security
519
- I11.030 Price
520
- Q9.066 Quantity
521
- T100.00 Amount
522
- MEst. price as of 8/25/93
523
- Memo
524
- L[CHECKING] Account for transfer
525
- $100.00 Amount transferred
526
- ^ End of the transaction
527
-
528
- At Intuit, we highly recommend that you backup your Quicken data
529
- regularly to protect against loss due to unexpected power failures,
530
- diskette damage or other mishaps. If you need further assistance,
531
- you may contact Intuit Technical Support at (415) 858-6050, Monday
532
- through Friday between 5 am and 5 pm Pacific time.
533
-
534
- --- Another entry of this info ---
535
- Export headers for QIF files
536
-
537
- Export headers in QIF files divide separate groups of items such
538
- as accounts or transactions. They can also signify options. Export
539
- headers follow the general format:
540
-
541
- !<Header name>:<Export type>
542
-
543
- Exportable accounts
544
-
545
- The table below lists the types of accounts that can be exported
546
- and their export headers:
547
-
548
- Export Header Type of account
549
- !Type:Bank Bank account
550
- !Type:Cash Cash account
551
- !Type:CCard Credit card account
552
- !Type:Invst Investment account
553
- !Type:Oth A Asset account
554
- !Type:Oth L Liability account
555
- !Type:Invoice Invoice account (business subtype of Oth A)
556
- !Type:Tax Tax account (business subtype of Oth L)
557
- !Type:Bill Bill account (business subtype of Oth L)
558
- An account header is followed by transaction records if there are
559
- any within the selected date range.
560
-
561
- Exportable lists
562
-
563
- The table below lists the types of lists that can be exported and
564
- their export headers:
565
-
566
- Export Header Type of list
567
- !Type:Class Class list
568
- !Type:Cat Category list
569
- !Type:Memorized Memorized transactions list
570
- !Type:Security Securities list
571
- !Type:Prices Security Prices list
572
- !Type:Budget Budgets list
573
- !Type:Invitem Invoice items list
574
- !Type:Template Business templates list
575
- A list header is followed by records of the selected list type.
576
-
577
- Options headers
578
-
579
- Below is the option you can use, and its action:
580
-
581
- Export Header Meaning
582
- !Option:AllXfr Forces transfers to be imported, even if Ignore
583
- Transfers is set.
584
- Account headers
585
-
586
- Export Header Meaning
587
- !Option:AutoSwitch Start of the Accounts list
588
- !Account Beginning of accounts list records
589
- !Clear:AutoSwitch End of the Accounts list
590
- !Account is followed by either a list of account records for the
591
- Accounts list or a single account record for the selected account
592
- transactions.
593
-
594
- Copyright (c) 1999 Intuit, Inc.
595
-
596
-
597
-
598
- Identifiers for non-investment accounts
599
-
600
- Use these letters to identify specific items in a non-investment
601
- account transaction. Each line in the transaction must begin with
602
- one of these letters:
603
-
604
- Letter What it means
605
- D Date
606
- T Amount of transaction
607
- U Amount of transaction (higher possible value than T)
608
- C Cleared status
609
- N Number (check or reference)
610
- P Payee/description
611
- M Memo
612
- A Address (up to 5 lines; 6th line is an optional message)
613
- L Category/class or transfer/class
614
- S Category in split (category/class or transfer/class)
615
- E Memo in split
616
- $ Dollar amount of split
617
- % Percentage of split if percentages are used
618
- F Reimbursable business expense flag
619
- ^ End of entry
620
- Repeat the S, E, % and $ lines as many times as necessary for
621
- additional items in a split. If an item is omitted from the
622
- transaction in the QIF file, Quicken treats it as a blank item.
623
-
624
- Copyright (c) 1999 Intuit, Inc.
625
-
626
-
627
- Identifiers for investment accounts
628
-
629
- Use these letters to identify specific items in an investment
630
- account transaction. Each line in the transaction must begin with
631
- one of these letters:
632
-
633
- Letter What it means
634
- D Date (optional)
635
- N Action
636
- Y Security
637
- I Price
638
- Q Quantity (# of shares or split ratio)
639
- C Cleared status
640
- P 1st line text for transfers/reminders
641
- M Memo
642
- O Commission
643
- L For MiscIncX or MiscExpX actions:Category/class followed by
644
- |transfer/class of the transaction
645
- For MiscInc or MiscExp actions:Category/class of the transaction
646
- For all other actions:Transfer/class of the transactions
647
- T Amount of transaction
648
- U Amount of transaction (higher possible value than T)
649
- $ Amount transferred
650
- ^ End of entry
651
- If an item is omitted from the transaction in the QIF file,
652
- Quicken treats it as a blank item.
653
-
654
- Copyright (c) 1999 Intuit, Inc.
655
-
656
-
657
-
658
- Identifiers for memorized transaction items
659
-
660
- Use these letters to identify specific items in a memorized
661
- transaction. Each line in the transaction must begin with one of
662
- these letters or combination of letters:
663
-
664
- Memorized transaction identifiers
665
-
666
- The table below lists the identifiers for Memorized Transaction
667
- items and what they mean:
668
-
669
- Letter What it means
670
- K Transaction type
671
- KI Memorized investment transaction
672
- KE Memorized regular electronic payment transaction
673
- KC Memorized regular write checks transaction
674
- KP Memorized regular payment transaction
675
- KD Memorized regular deposit transaction
676
- Q Quantity (number of new shares for a split)
677
- R Quantity (number of old shares for a split)
678
- You can also use the identifiers for investment and non-investment
679
- transactions, as necessary. Electronic payments, write checks,
680
- payments, and deposits are regular transaction types.
681
- Memorized loan payment also supports the following identifiers:
682
-
683
- Letter What it means
684
- 1 First payment date
685
- 2 Total years of the loan
686
- 3 Number of payments made
687
- 4 Payment periods per year
688
- 5 Loan rate
689
- 6 Current balance of the loan
690
- 7 Original balance of the loan
691
-
692
- Copyright (c) 1999 Intuit, Inc.
693
-
694
-
695
- Identifiers for business transaction items (Home & Business)
696
-
697
- Use these letters to identify specific business-related items in a
698
- non-investment account transaction. Each line in the transaction
699
- must begin with one of these letter combinations:
700
-
701
- Letter What it means
702
- XI Invoice type
703
- XE Payment due date
704
- XU Number of payments
705
- XD Date for a payment
706
- XY Payment amount
707
- XC Sales tax Category
708
- XR Sales tax rate
709
- XT Sales Tax amount
710
- XP PO number
711
- XA Shipping/Vendor address (up to 5 lines)
712
- XM Customer message
713
- XK Default split class
714
- XN Name of invoice item
715
- X$ Price per item of a split
716
- X# Number of items in a split
717
- XS Split item description
718
- XFT Taxable split item flag
719
- ^ End of entry
720
- Repeat the XS, XK, X Ft, X# and X$ lines as many times as
721
- necessary for additional items in a split. If an item is omitted
722
- from the transaction in the QIF file, Quicken treats it as a blank
723
- item.
724
-
725
- Copyright (c) 1999 Intuit, Inc.
726
-
727
-
728
-
@@ -1,29 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{qif}
5
- s.version = "1.1.0"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Jeremy Wells"]
9
- s.date = %q{2011-03-07}
10
- s.description = %q{A library for reading and writing quicken QIF files.}
11
- s.email = %q{jemmyw@gmail.com}
12
- s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc", "lib/qif.rb", "lib/qif/date_format.rb", "lib/qif/reader.rb", "lib/qif/transaction.rb", "lib/qif/writer.rb"]
13
- s.files = ["CHANGELOG", "LICENSE", "Manifest", "QIF_references", "README.rdoc", "Rakefile", "lib/qif.rb", "lib/qif/date_format.rb", "lib/qif/reader.rb", "lib/qif/transaction.rb", "lib/qif/writer.rb", "spec/fixtures/3_records_ddmmyy.qif", "spec/fixtures/3_records_ddmmyyyy.qif", "spec/fixtures/3_records_dmyy.qif", "spec/fixtures/3_records_invalid_header.qif", "spec/fixtures/3_records_mmddyy.qif", "spec/fixtures/3_records_mmddyyyy.qif", "spec/fixtures/3_records_separator.qif", "spec/fixtures/not_a_QIF_file.txt", "spec/fixtures/quicken_investment_account.qif", "spec/fixtures/quicken_non_investement_account.qif", "spec/lib/date_format_spec.rb", "spec/lib/reader_spec.rb", "spec/lib/transaction_spec.rb", "spec/lib/writer_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "qif.gemspec"]
14
- s.homepage = %q{http://qif.github.com/qif/}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Qif", "--main", "README.rdoc"]
16
- s.require_paths = ["lib"]
17
- s.rubyforge_project = %q{qif}
18
- s.rubygems_version = %q{1.6.1}
19
- s.summary = %q{A library for reading and writing quicken QIF files.}
20
-
21
- if s.respond_to? :specification_version then
22
- s.specification_version = 3
23
-
24
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- else
26
- end
27
- else
28
- end
29
- end