Jump to content

Wikipedia:Reference desk/Archives/Computing/2012 April 27

From Wikipedia, the free encyclopedia
Computing desk
< April 26 << Mar | April | May >> April 28 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


April 27

[edit]

MS-Excel

[edit]

What is MS-Excel? — Preceding unsigned comment added by Aadya mishra (talkcontribs) 05:14, 27 April 2012 (UTC)[reply]

It means Microsoft Excel. Bubba73 You talkin' to me? 05:37, 27 April 2012 (UTC)[reply]

iPhone Camcorder/iMovie

[edit]

Why cannot i import camcorder films from my iPhone into iMovie please?--85.211.154.241 (talk) 05:56, 27 April 2012 (UTC)[reply]

Do any of these links help?[1][2][3] If not, it would be useful if you told us the particular problem you are having and the version of iMovie and other software you are using. --Colapeninsula (talk) 09:04, 27 April 2012 (UTC)[reply]


iPhone3 and iMovie 11.--85.211.154.241 (talk) 15:12, 27 April 2012 (UTC)[reply]

Sorry, forgot to thank you for the links, I think that the first one will be helpful. — Preceding unsigned comment added by 85.211.154.241 (talk) 15:18, 27 April 2012 (UTC)[reply]

Leading spaces are stripped out of Access table

[edit]

I am using Access 2007 and importing data from a .csv file into text fields in a table. Some of the text fields have leading spaces which are needed and I want to keep them but Access strips them all out when the data is imported. How can I stop this happening please? Gurumaister (talk) 07:39, 27 April 2012 (UTC)[reply]

Can you put quotation marks around the individual data items, including the leading spaces? Comma-separated values suggests this. --Colapeninsula (talk) 09:10, 27 April 2012 (UTC)[reply]

Unfortunately, I can't. The .csv is an export of a name and address file from another (non-Access) database so the data comes out without quotation marks. Surely having leading spaces stripped out should be a matter of choice and therefore optional? I am finding it very frustrating. Gurumaister (talk) 13:22, 27 April 2012 (UTC)[reply]

Access handles all unquoted spaces before data as just ignorable whitespace and ignores it. I don't see any way around that with Access's interface. Your options, as I see them, are 1. Have the other database spit out the data in a quoted fashion, or 2. Put together some kind of CSV pre-processor that adds the quotes in for you automatically. (The latter is only a moderately difficult scripting task, as far as scripting tasks go.) --Mr.98 (talk) 14:27, 27 April 2012 (UTC)[reply]
This Python script does that (blindly - even elements without whitespace get quoted anyway). It reads stdin and write stdout. -- Finlay McWalterTalk 14:55, 27 April 2012 (UTC)[reply]
#!/usr/bin/python
import csv,sys
for r in csv.reader(sys.stdin):
    for i in range(0,len(r)):
        r[i] = '"%s"'%r[i]
    print ','.join(r)
Can you get an intermediate file between database 1 and 2 (this is in line with what 98 talks about as a pre-processor)? Shadowjams (talk) 16:02, 27 April 2012 (UTC)[reply]
Can you predict which fields should have leading white-space? If so you can write an update query in Access that re-adds the whitespaces back in as part of either the import routine or a separate query post import of data. ny156uk (talk) 13:52, 28 April 2012 (UTC)[reply]
Presumably the amount of whitespace varies in an unpredictable way, otherwise it would be a simple workaround to just tack on some whitespace. --Mr.98 (talk) 14:41, 28 April 2012 (UTC)[reply]

Python exception fail

[edit]
Resolved

Why isn't this exception caught?

try:
    j = "rgb".index(instring.pop(0))
    ...
except ValueError,IndexError:
    ...
Traceback (most recent call last):
 File "mug1.py", line 36, in <module>
   j = "rgb".index(instring.pop(0))
IndexError: pop from empty list

I tried unpacking the expression:

    ch = instring.pop(0)
    j = "rgb".index(ch)

but that didn't help. —Tamfang (talk) 19:37, 27 April 2012 (UTC)[reply]

You need parens around ValueError,IndexError to make it a tuple. As it is you're catching ValueError into an object called IndexError. --Sean 19:48, 27 April 2012 (UTC)[reply]
I see. That's a feature I haven't used much. Thanks! —Tamfang (talk) 00:06, 28 April 2012 (UTC)[reply]