From owner-freebsd-questions@FreeBSD.ORG Sat Feb 14 01:40:36 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1700163E for ; Sat, 14 Feb 2015 01:40:36 +0000 (UTC) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAF2B964 for ; Sat, 14 Feb 2015 01:40:35 +0000 (UTC) Received: from r56.edvax.de (port-92-195-63-165.dynamic.qsc.de [92.195.63.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id A1BE227629; Sat, 14 Feb 2015 02:33:06 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id t1E1X5Z2003080; Sat, 14 Feb 2015 02:33:05 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 14 Feb 2015 02:33:05 +0100 From: Polytropon To: Rolf Nielsen Subject: Re: Batch editing an SQLite db Message-Id: <20150214023305.fab9370d.freebsd@edvax.de> In-Reply-To: <54DE6371.4070609@gmail.com> References: <54DE6371.4070609@gmail.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: User questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2015 01:40:36 -0000 On Fri, 13 Feb 2015 21:49:53 +0100, Rolf Nielsen wrote: > I recently changed from one ROM to another on my Android phone. The > old one and the new one use different mount points for the external SD > card, and because of this the music playlists I've painstakingly > created are utterly useless. The player refuses to even open them, > because the files in them are non-existent. These are SQLite database > files, and I've been able to open them with the SQLiteEditor app for > Android, but I've not found an option to replace all occurances of a > string with something else. I have eight playlists with some 500 songs > each, so editing them manually would be tedious. Is there something in > the ports tree that can do this? SQL isn't a language I speak > fluently, so I'd need some pointers as well. Basically I need to > substitute "sdcard1" for "extSdcard". Do you have r/w access to the database file and a SQLite installation you can use? Then you can use its replace() function with an UPDATE command: UPDATE SET = replace(, 'sdcard1', 'extSdcard') WHERE LIKE '%sdcard1%'; Here is the name of the table which contains the playlist entries, and is the "column name" under which playlist entriy paths are stored. "Sadly", I don't have to mess with SQL regularly anymore. So not tested. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...