Luc,

I have copied and pasted sections of a command file in order not to confuse
you with things that I do and you don't need to so this is not a complete
solution. However, it should give you enough ideas to see how to take what's
here and adapt it for your needs. If it doesn't just ask again!

-- ---------------------------------------------------------------------------
-- Create directory list:
-- ---------------------------------------------------------------------------
 OUTPUT PicDir.BAT
   WRITE '@ECHO OFF'
   WRITE +
   'DIR', .vFileSource, '/-P /O:-GNE /A:-D /-C > D:\DBFILES\PicDir.FLE'
   WRITE 'EXIT'
 OUTPUT SCREEN
 LAUNCH D:\DBFILES\PicDir.BAT|W

-- ---------------------------------------------------------------------------
-- Create temp table:
-- ---------------------------------------------------------------------------
 DROP TABLE        `Temp_Data_Load`
 CREATE TEMP TABLE `Temp_Data_Load` +
  (Tmp_File_Date  TEXT  (10), +
   Text_File_Size TEXT  (12), +
   Orig_File_Name TEXT  (80), +
   Tmp_Graphic_Type = +
(LUC( (SGET(Orig_File_Name, 3, ( (SLOC(Orig_File_Name, '.')) + 1) )) )) TEXT
(3) )

-- ---------------------------------------------------------------------------
-- Load temp table and remove junk:
-- ---------------------------------------------------------------------------
 LOAD `Temp_Data_Load` FROM PicDir.FLE AS FORMATTED USING +
   Tmp_File_Date   1  10, +
   Text_File_Size 24  35, +
   Orig_File_Name 37 117

 DELETE ROWS FROM `Temp_Data_Load` WHERE Tmp_Graphic_Type +
NOT IN ('JPG', 'BMP', 'GIF')
 DELETE ROWS FROM `Temp_Data_Load` WHERE Tmp_Graphic_Type IS NUL

 UPDATE Temp_Data_Load SET Text_File_Size = (LTRIM(Text_File_Size))
 UPDATE Temp_Data_Load SET Text_File_Size = (SRPL(Text_File_Size, ',', '',
0))

 UPDATE Temp_Data_Load SET Orig_File_Name = (SRPL(Orig_File_Name, '/', '_',
0))
 UPDATE Temp_Data_Load SET Orig_File_Name = (SRPL(Orig_File_Name, '\', '_',
0))

-- ---------------------------------------------------------------------------
-- Compile the report:
-- ---------------------------------------------------------------------------
 PRINT LoadData +
   ORDER BY Orig_File_Name +
   OPTION ETXT |FILENAME VisLoad.FLE |OPEN OFF |SHOW_CANCEL_DIALOG OFF
 LAUNCH VisLoad.FLE||W

At this point I use a report that writes a command file to load the data. I
do so because I set various other columns at the same time and it gives me
easier control and an ability to check the file before loading. I have shown
it as an option for you. However, you have all you need in the temp table to
use an SQL command to insert the data to your "real table". If it's a once
only operation you might even decide that you can make the temp table
permanent. Make it temp while you're experimenting...

Either way, I suggest that you have only an id number to link to another
table along with the file in whatever data type is suitable for your needs
in your permanent table. It will, presumably be a large amount of data and,
if so, you will probably find it easier in the long run to handle the
documents in a linked table rather than all together with other data. R:Base
will be fine either way - I just find it suits my way of working.

So, assuming that you don't want to create a report, you need to run a cursor through the temp table and create a command that loads each file into your main table. For example it might be something like this:

INSERT INTO MainTable (Col1_ID, Col2_FILE) +
VALUES (Intro_L1, ['D:\DBFILES\GENERAL\156Aerial.JPG'])

I've shown the path just as a reminder that you need it if the files aren't in your working directory!

Good luck,
Regards,
Alastair.



--------------------------------------------------
From: "Luc Delcoigne" <[email protected]>
Sent: Monday, August 23, 2010 5:32 PM
To: "RBASE-L Mailing List" <[email protected]>
Subject: [RBASE-L] - re: uploading .doc in rbase

Alastair,

making a program to convert the .docs to .rtfs doesn't seem too difficult.

The second part seems somehow more cumbersome to me.
So if you could give me that head start....I would accept it very
gladly....

best regards,

Luc D.

--------------------------------------------------
From: "Alastair Burr" <[email protected]>
Sent: Monday, August 23, 2010 6:21 PM
To: "RBASE-L Mailing List" <[email protected]>
Subject: [RBASE-L] - re: uploading .doc in rbase

If you can record & edit or write a macro in Word you can convert your
files to .RTF if you want to go that route.

It's possible to write a command file in R:Base to list your directory(s)
containing the files, load the results into a temp table then insert the
files to your database using the temp table to locate the files.

If you need help with the second part I can copy and paste an example for
you - if you let me know - that should give you a head start.

Regards,
Alastair.


--------------------------------------------------
From: "Luc Delcoigne" <[email protected]>
Sent: Monday, August 23, 2010 4:39 PM
To: "RBASE-L Mailing List" <[email protected]>
Subject: [RBASE-L] - re: uploading .doc in rbase

Hello Razak,

thanks for the tip.
But this seems to be a very 'manual' way to do it and quite achievable
for a
small number of documents.

However I have to read more than 80.000 word-documents into the
database.
It
then seems not an option to do this manually.
Isn't there a way to automate this and speed things up ?

Luc D.

--------------------------------------------------
From: "A. Razzak Memon" <[email protected]>
Sent: Monday, August 23, 2010 5:19 PM
To: "RBASE-L Mailing List" <[email protected]>
Subject: [RBASE-L] - re: uploading .doc in rbase

At 10:34 AM 8/23/2010, Luc Delcoigne wrote:

in my Access > Rbase conversion I have come to the point that
I have to load .doc files into the varchar field of an rbase
table.

What would be the most elegant way to this, considering there
are more than 80.000 files to upload in the table....?

Luc,

Here's how I have converted/stored all .doc files into R:BASE.

01. Open the original .doc file(s) in MS Word and then save as
    .RTF to preserve the original formatting, etc.

02. Then, load these .rtf file(s) in R:BASE as VARCHAR or BLOB
    (VARBIT) data type.

    Use the appropriate data type (VARCHAR/VARBIT) accordingly.

03. Once stored in R:BASE, you may take advantage of enhanced
    Blob Editor to manage all your documents, etc.

    Tip:

    When using the enhanced R:BASE BLOB Editor, make sure to
    select [Rich Text] option/tab to manage .rtf files.

04. To print these documents in R:BASE eXtreme 9.0 reports,
    make sure to use Advanced DB Rich Text Control.

That's all there is to it!

2010 Annual R:BASE Conference Highlights include a session to
demonstrate the use of such features in R:BASE eXtreme 9.0.
http://www.rbase.com/conference/

Very Best R:egards,

Razzak.








No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.851 / Virus Database: 271.1.1/3088 - Release Date: 08/22/10
19:35:00









No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.851 / Virus Database: 271.1.1/3088 - Release Date: 08/22/10
19:35:00



Reply via email to