Copy all text in the source comment field to the source text field

Quote from Matthew Friend on 2023-02-25, 9:36 pmTom... you have been very helpful this week, thankyou.
I have just one more thing I'd like to do and then I promise to leave you alone (at least for a good while lol).
So I know have my 15,000 plus source comment fields cleaned up from the extra urls.
This family tree was imported originally from a different family tree software. After looking at them today, it seems that 95% of the data that is in the source comments fields should actually be in the source text fields (transcriptions mainly). What I would like to do is for each Source, copy all of the source comment field into the source text field. Could you whip me up some of your magic on that 🙂
I think my database will be in pretty good shape then 🙂
Matthew
Tom... you have been very helpful this week, thankyou.
I have just one more thing I'd like to do and then I promise to leave you alone (at least for a good while lol).
So I know have my 15,000 plus source comment fields cleaned up from the extra urls.
This family tree was imported originally from a different family tree software. After looking at them today, it seems that 95% of the data that is in the source comments fields should actually be in the source text fields (transcriptions mainly). What I would like to do is for each Source, copy all of the source comment field into the source text field. Could you whip me up some of your magic on that 🙂
I think my database will be in pretty good shape then 🙂
Matthew
Uploaded files:
Quote from Tom Holden on 2023-02-25, 10:45 pmI really should let you figure that one out because it is so simple:
UPDATE SourceTable
SET ActualText=Comments, Comments=''
--WHERE someconstraint -- if some should not be moved
;That will move the values from Comments to ActualText. If the 5% you mention should not be moved, you would have to find some pattern in the Comments by which you could constrain the update to all records but those. If it was the presence of the "http" at the start of the Comments values that distinguishes the 95%, then moving first and then eliminating the URLs would be sensible.
I really should let you figure that one out because it is so simple:
UPDATE SourceTable
SET ActualText=Comments, Comments=''
--WHERE someconstraint -- if some should not be moved
;
That will move the values from Comments to ActualText. If the 5% you mention should not be moved, you would have to find some pattern in the Comments by which you could constrain the update to all records but those. If it was the presence of the "http" at the start of the Comments values that distinguishes the 95%, then moving first and then eliminating the URLs would be sensible.

Quote from Matthew Friend on 2023-02-26, 11:52 amThat worked perfect, thank you Tom.
On a side note I have been reading some on the "Sqlitetutorial.net" page and figured out how to replace text that meets certain conditions and it worked out good 🙂
(https://www.sqlitetutorial.net/sqlite-replace-function/)
Matthew
That worked perfect, thank you Tom.
On a side note I have been reading some on the "Sqlitetutorial.net" page and figured out how to replace text that meets certain conditions and it worked out good 🙂
(https://www.sqlitetutorial.net/sqlite-replace-function/)
Matthew