From owner-freebsd-questions@FreeBSD.ORG Sat Feb 14 02:11:51 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACE4791C for ; Sat, 14 Feb 2015 02:11:51 +0000 (UTC) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ACE3C05 for ; Sat, 14 Feb 2015 02:11:51 +0000 (UTC) Received: by labge10 with SMTP id ge10so19587282lab.12 for ; Fri, 13 Feb 2015 18:11:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=8wyWg+8e3WMjkeRyilA1mWHwi9PG/nxQyiXf5W6APsA=; b=eovjscrJkBzB0dsckSkokWzlNC33ONiIs32zwE2J/FMFRYI/0TCl/hF6eWmZZKAHUA 6dkJ+JKZyPoe50/Kpz/cc0DMs7iXZ5SMKkeonWOp1nyObZ4L4cqhwZqtVTY1rNwVe74m y4FUNE5vl38r4dQ+fg7jnHVNHVm6OOPne3scfI/k6VJeyFXHueqfZDWUHSullsufCjWM GJPP7rISfzygszVNHxG8lAKpk+jBafTqEMsPd9f0LbkAHxpsJ5+Cz4jr7n3VCVYPLRvA jaARIXuBwUWl/N1CT8JbTVkP6VdYHmUfzQ3kIsfk6m5BnF9fwGUc5fvEY2Ck0l7abvfU bC6Q== X-Received: by 10.112.126.98 with SMTP id mx2mr10918143lbb.84.1423879909055; Fri, 13 Feb 2015 18:11:49 -0800 (PST) Received: from lazlar.no-ip.biz (213-64-218-92-no126.business.telia.com. [213.64.218.92]) by mx.google.com with ESMTPSA id wq3sm1662816lbb.24.2015.02.13.18.11.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 18:11:48 -0800 (PST) Message-ID: <54DEAEE4.5090704@gmail.com> Date: Sat, 14 Feb 2015 03:11:48 +0100 From: Rolf Nielsen User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Polytropon Subject: Re: Batch editing an SQLite db References: <54DE6371.4070609@gmail.com> <20150214023305.fab9370d.freebsd@edvax.de> In-Reply-To: <20150214023305.fab9370d.freebsd@edvax.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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 02:11:51 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2015-02-14 02:33, Polytropon wrote: > 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. :-) > > I have root access to my phone, so r/w access isn't going to be a problem. I also have SQLite installed (as a dependency of some other port(s)) on my home computer. I will try this during the weekend. If I'm not mistaken, you and I are in the same TZ, which means we're both up so late it's actually early... Suffice it to say, I'm not up for the task right now. I'll report back once I've tried it. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU3q7XAAoJEPJMW41Co4JgsncP/3x+qxqvC2WxAJccvep51TFz gbMFIpej4aYkte1u9outePPP5QATmyEu8bpkxP1H37gcuqyPBw5eT2ZLoQmF8QER 8Ghxwh4mV2+wvyW3XmaxGxIC01wOcZfHmPRFfGv43laIjzMaV50EBmN4Wuy+HOPT k/AVgwAjMRFhqJV7sncwLgRkIHxQ9J6Hlw+sPscEMPYQHt+A07THCwoNgBQuC529 CLK/qCHi4KVnEy/NWS4ucGphCoIL4wjmdYhDQEipMRxJtby+GnIeE5P4YjJ8J/+F sgvLrzYNmFuwJ7Coi5ixLxtfBoVjKu1ym/9GjHWAUNfv+wkHgwAvMD4yA6gNaPWv dVkIrETawSgPX2RSzbz36vinMpPVULoR8AmRtb8tNR8OdRYXT2eZteQ7xUIpBQJC ET7QrFFDOvLi8ORlqWlJLjEjV4ziQoJEzq4T9f0CLmzez+1uK3qKC0vKIpHQ9nf2 D7iFHjMmtOIN72o+aytg2ZLU8twcTupbI4OBSdEXft5Nzx/gSu9IddiVs1E/Q7Bp ID0Etoy8ITwE8iiFWj6cmoUmeZx/rMjmtE5kbaauGVaeKl8r6srnrqcJlIXn3Pq5 43RC5PrlJi0SXALVT4DVOc0yZGDSyOP9kF89UyOMlZjhzAxN3jW7LNKHdR1FA4yE ewNYyOZjgwsgzJIGw08O =aRxG -----END PGP SIGNATURE-----