From owner-freebsd-questions@FreeBSD.ORG Sun Feb 15 13:59:28 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 07C8B41A for ; Sun, 15 Feb 2015 13:59:28 +0000 (UTC) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) (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 8317FACC for ; Sun, 15 Feb 2015 13:59:27 +0000 (UTC) Received: by labms9 with SMTP id ms9so18126777lab.10 for ; Sun, 15 Feb 2015 05:59:25 -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=YPVZhJozGAYqDLNNqw4YHGq8sKPCCQo/nuArMTADh6M=; b=E1nO+ZQL4XBXSd/nVgYHIz8YbZ7P889JgraiUq2XMQ1kLQgaIs40ptH++leLNZSqDs 5TaVxVRaBAWKPdT9bJ53JftWkFvqNN4f3kkbwg2piGjAVK9xoeIaOTcYGt7+iFASX5A5 Z7i3SzKH1lDlt8NjNeyoXLKvrVGtLOKx8E3iJpuZwxt/Y9xYsNzYwK+oXuh46ahLhd3P 75UQPiII3zLYWr4EsdshJH8W0bxOOiZ6avKZOLR0I1CINuuDwAPmoni6+f/tdFm9kU1N ofdKbxrlyDYBai7LTv0o85mT5Azt35uhpxghR7AsNGiaF7jmZOT1N1ME2F4kPe5q8OaP HJ1A== X-Received: by 10.112.27.173 with SMTP id u13mr17731718lbg.7.1424008765331; Sun, 15 Feb 2015 05:59:25 -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 ks4sm88482lac.23.2015.02.15.05.59.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Feb 2015 05:59:24 -0800 (PST) Message-ID: <54E0A63C.4080504@gmail.com> Date: Sun, 15 Feb 2015 14:59:24 +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: 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: Sun, 15 Feb 2015 13:59:28 -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 now tried, and I'm happy to report that you saved not only my day or even week, but my whole year. Thanks. :) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJU4KYuAAoJEPJMW41Co4Jg1ukQAJDvYTt1pM603GDS4JX5VHku EvEmxfwFC06oCkOM8d10qZJJu36t5JbHNZ8QGvRJHWjFwIBCq4eKust6r2U85cFi skkw65C1O/6prHRRTzLuIaknmcyyrj/chBFt/11qOhYuheeSC93CMUQUBxGHpY0i O7e8X6KZcTDA2CGBRIfqCl+GugBvtqKffoDjGcKzmVdtfWo7DY+tY+9MHNEG0Qag xhv5jZq4Bq+XzTROOG93tNQemrEFcMwYATCjjaS44KPSdrLbh1AWpEVO+eHrQ6+D epSBt24o6JR/9dMXeFdRP4hoQjItcObrL7+B2fnJSLqaVlwcDOJSs07ps75x/wer oeqV38tfvcsEpUeXb5S0FN8pWc9JJ3Q87WBIHv8CBZw3cszV/cte3xvHJI8v7Unp LNctS1+vGsFt5GENqKomZdKTn91v/xSiGsEgWAqwRp2EOl9wA5vweGHy468hpHX2 UaXqaBHejA5Av0GjYCjgJB+vyQzESXY7oruQmjkLeIKjrXR/KGQntKK2P214aGAN FN4a8SVeWGs1TVtypluOuHrAkcrdQmURGzO1MqFy7HE+k1jE9G0E9kyB9yjnxG5L JMi5NGBUrclMTWqjyxQ3Yoi/w43V8SuknoMQ6D9Wn72+SXTGiKEhNNYIKwrSPfb6 lBHOsMU2b2yfWHZx3scC =vO/v -----END PGP SIGNATURE-----