Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - making a text file file into a database
Page 1 of 1

PostPosted: Fri Sep 14, 2007 8:52 pm
by fembot1966
Hi,

Thanks for all the good answers, Dewey. I have the simulator running now. It was very exciting! I got it to run one of my programs. It's not running perfectly but well enough for the moment.

For my application i want to turn a text file on my desktop into a database. I looked in the HTML docs and there doesn't seem to be any function for this. I saw functions for creating and building a database, but none for importing data. In my old days as a database programmer i would have just said 'APPEND FROM FILENAME FOR TYPE = TXT' but i don't see anythink like that anywhere in PocketC.

What should i do?

Thanks.

PostPosted: Sun Sep 16, 2007 6:46 am
by samps
Have a go at OrbPDB from Orbworks. It's a free utility that turns text into Palm PDBs...

http://www.orbworks.com/other/orbpdb.html

did I mention it's free....!?

Samps

Ubuntu user #82

PostPosted: Mon Sep 17, 2007 12:57 am
by fembot1966
Thanks to Samps for the info on conversion. I must be doing something wrong tho. It says it can't access the destination file. Here's my command line:

orbpdb -csv -a -rA- -s8 see_you.csv my_data.pdb

Do you have to create the database beforehand? I didn't specify a database name, type or creator ID because it says not to if you're using the -a for append switch. Is this right? What am i doing wrong?

Thanks.

PostPosted: Mon Sep 17, 2007 1:07 am
by samps
My guess (haven't tested) is that in order to use the append switch (-a), there has to be an existing file that you can append stuff to.

Try creating a file from scratch, using only the required parameters:

orbpdb -csv -s8 see_you.csv my_data.pdb

and see how you go.

Samps

Ubuntu user #82

PostPosted: Mon Sep 17, 2007 8:12 pm
by fembot1966
Hi Samps,

It asked for the database specifications. When i gave it those it said it couldn't read the source csv.

Thanks.

PostPosted: Mon Sep 17, 2007 9:45 pm
by samps
Okay,


This time I actually pulled the old Orbpdb out of the drawer and tested it. Turns out I had the syntax slightly wrong in the above.

orbpdb -csv -c stAB s8 test.csv test.pdb

without a dash before the format string but WITH the addition of a creator ID. Those you get from Palm Developer Network or you make up any four-letter combination of upper and lowercase letters ad numbers just for your testing.

This creates a new palm database, now you can use the -a switch to append to data to it.

Sorry for creating confusion by not checking my facts earlier in the process.

Samps

Ubuntu user #82

PostPosted: Tue Sep 18, 2007 12:38 am
by fembot1966
Hi Samps,

It worked! A triumph! The only thing is on the Palm i get funny ASCII characters after each record. This is in using puts() to look at them. Also, the new line symbol won't work. Ack! Do you know what to do? Oh, well, some progress!

Thanks.

PostPosted: Tue Sep 18, 2007 3:06 am
by samps
Here's a guess:

Your data, while still in Windows format, are ordered in lines:

first_string
second_string
third_string

instead of

first_string,second_string,third_string

and the extraneous characters are carriage returns and line feeds (CR+LF)



I'm not sure what you mean by "new line symbol not working"? I know the manual says: Add a "\n" after your string to get a new line... Don't include the quotation marks, just the raw \n

Samps




Ubuntu user #82

PostPosted: Tue Sep 18, 2007 8:26 pm
by fembot1966
Hi Samps,

Yes, that's exactly it. My data is in a column and not a paragraph. Those pesky characters must be LF+CRs. I guess my file's not really Comma Separated Variables. Any ideas on some thing that will do a bona fide text file to pdb?

I'll try your suggestion for the new line operator. Is it correct to say it's an 'operator'? What do you call it? Symbol? It sure doesn't like it in quotes. Perhaps raw will go over better.

PostPosted: Tue Sep 18, 2007 9:14 pm
by samps
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">the new line operator. Is it correct to say it's an 'operator'? What do you call it? Symbol? It sure doesn't like it in quotes. Perhaps raw will go over better.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">

I usually refer to it as "the new-line character", it goes at the end of the string, within the quotation marks that encloses the string:


Code: Select all
     puts("Hi there\n");



Samps

Ubuntu user #82

PostPosted: Wed Sep 19, 2007 1:38 am
by fembot1966
Hi Samps and all,

The new line character must be interacting with my CR+LFs. It works OK for plain text.

I've been fooling around with PDBConverterLE. It SAYS it's created a .pdb. It's on my hard drive. But it doesn't sync across! At least my program bombs and says there's a null string and i have to reset. When i go to the main menu, tap on time and tap info, it's not there either. The .pdbs i created with ORBPDB are there but not the ones i created with this fancy converter.

Any ideas?

Thanks.

PostPosted: Wed Sep 19, 2007 5:01 am
by samps
The difference between 'there' and 'not-there' .PDBs (and determinant to whether they can be sync'ed or not) might be in the presence (or absence) of a creator ID. Orbpdb checks that one is present, does PDBConverter?
Also, utilities like Z'Catalog might be able to tell, in greater detail, which .PBs are on the Palm, than the Launchers Info.

Samps

Ubuntu user #82

PostPosted: Fri Sep 28, 2007 11:23 am
by mickeyfarren
Hi trying to convert a pdb file to a csv file, the database has just 10 records each with 3 fields and each of the fields?¢‚Ǩ‚Ñ¢s is 30 characters long. I tired the following Orbpdb ?¢‚Ǩ‚Äúpdb ?¢‚Ǩ‚Äúr0- 3szs30 pwds.pdb pwds.csv and messed around with different combinations of the 3szs30 part of the command, but all I get in the csv file is the record number for the 10 records i.e. the first entry of the record. Anybody got any ideas where I?¢‚Ǩ‚Ñ¢m going wrong?:x

PostPosted: Tue Oct 02, 2007 6:41 pm
by dewey
Your type string means: 3 null-terminated strings follwed by a 30 character fixed length string. According to your description of the database, this is what you want:

orbpdb -pdb 3s30 pwds.pdb pwds.csv

Note: the -r is optional. If not provided, it will convert all records.

PostPosted: Tue Oct 02, 2007 8:05 pm
by mickeyfarren
dewey
Thanks that sorted it.