Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 4th, 2008, 2:45 PM   #1
bias
Newbie
 
Join Date: Jun 2008
Posts: 2
Rep Power: 0 bias is on a distinguished road
Convert list?!

Hi. Need some urgent help, beeing fairly new to programming. I have a list of files containing pdf files with a barcode. They are scanned invoices with a barcode label on the first page of every invoice (one invoice can consist of one or many pages). I can extract all pages to single pdf files, and i can scan each file for a barcode, i have come so far as a list like this:

1
1
0
0
1
0
1
1
1
0
1

Where 1 is Barcode found, and 0 is barcode not found, easy enough?! Well, i need to convert this list to somthing that will look like this:

1
2-4
5-6
7
8
9-10
11

Have been trying for a long time, and my eyes are about to pop out of their sockets, not beeing able to solve the problem. And it's probably easy too... for someone who have the knowledge. So please, please help me out here!


Thanks.
bias is offline   Reply With Quote
Old Jun 4th, 2008, 6:44 PM   #2
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
Re: Convert list?!

not sure I understand what you want. What does the second list represent?
OpenLoop is offline   Reply With Quote
Old Jun 4th, 2008, 9:45 PM   #3
casesensitive
Programmer
 
Join Date: Oct 2007
Posts: 41
Rep Power: 0 casesensitive is on a distinguished road
Re: Convert list?!

Quote:
Originally Posted by OpenLoop View Post
not sure I understand what you want. What does the second list represent?
The second list looks like a chart for which positions hold a one value. To the original poster. Are you trying to convert binary to decimal?
casesensitive is offline   Reply With Quote
Old Jun 5th, 2008, 12:24 AM   #4
bias
Newbie
 
Join Date: Jun 2008
Posts: 2
Rep Power: 0 bias is on a distinguished road
Re: Convert list?!

Sorry for the poor explenation.

What i am trying do accomplish is this: a user scans a batch of paper invoices, the output from the scanner is one PDF with x pages. An invoice can consist of one more pages, but the first page for every invoice has a barcode on it with an id. I want to create some kind of page separation, extracting the invoices by the barcodes. So far, i have managed to separate all the pages to files, scan for barcode and verify them, and i have the results in some stringlists, one list with the filenames, one list with barcode status, one list with the barcodes and so on. And in the barcode status string list, i have the numbers representing on/off if barcode is found. I will then take the first input file and do the actual separation.

When i will extract the invoices from the first input file, i use PDFToolkit, and the code for extraction is:

pdf1.extractpages('filename','1-2'); // Where 1-2 is page range.

TStringList (barcode status)
1
1
1
0
0
1
0
1
1

->

TStringList (PAGES TO EXTRACT)
1
2
3-5
6-7
8
9

Better understanding?
bias is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
linked list problems bl00dninja C++ 6 Feb 17th, 2008 10:30 AM
singly-linked list templaste class in C++ w/ example driver bl00dninja Show Off Your Open Source Projects 0 Sep 11th, 2006 1:05 AM
Singly Linked List Help Firebar Java 3 May 22nd, 2005 10:56 AM
User-defined creatNode and deleteNode functions for a doubly-linked list jgs C 2 Apr 28th, 2005 8:53 AM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 4:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC