format

Counting unique data in a column and then matching it with another unique data

久未见 提交于 2019-12-13 02:25:57
问题 This is an embarrassingly simple question, but I was not able to find a way to figure it out for hours nor also to find an idea from online search. Suppose I have the following data (the actual data can be thousands or millions) in Excel sheet (Table 1): Name No. ID A A1 B B4 B B5 C C0 D - A A1 A A2 E - F - C C0 B B5 B B5 B B5 B B6 A A1 A A1 A A2 B B3 B B3 B B3 The character (-) in column No. ID above can be also a number 0 or a blank cell. I want to format the above data as follow (Table 2)

XSLT formatting numbers, insert '-' after every 4 digits starting from the right most digit

和自甴很熟 提交于 2019-12-13 02:14:15
问题 I have a number that's 27 digits long, I need to format for readability purposes as below : Input : 999967799857791961574987365 Expected output : 999-9677-9985-7791-9615-7498-7365 So in words, Starting from the right most, I need to insert a '-' after every 4 digits . I have been using <xsl:value-of select="format-number($ID, '###-####-####-####-####-####-####-####')" /> but it doesn't work at all. Any help or pointers would be great..Cheers 回答1: The reason you can't just pass in the format

Support ANSI terminal color escape sequences in XML?

时光怂恿深爱的人放手 提交于 2019-12-13 02:11:42
问题 I am using "termcolor" and "colored" for printing some colored words in my test script. >>> from termcolor import colored >>> result = colored("pass", "red") >>> print result pass ----> ("appears in red") >>> result = '\033[1m' + result + '\033[0m' >>> print result pass ------> ("appears in red and bold") The above works fine on Mac and CentOS but fails to print it in red or bold in eclipse (on CentOS). It prints something like this "?[32mPASS?[0m" -- which does not help much.. I want to add

How to convert text to date format in Excel

与世无争的帅哥 提交于 2019-12-13 01:34:41
问题 I need to sort this column chronologically, however when I import the data, some of the cells are recognized as a a custom format (A2-A4) while others are in a general format (A5-11). A2-A4 is recognized as a date, however A5-A11 is being recognized as general text. Excel is not recognizing that these should all be dates. I have tried formatting them as a date, but this does not work. I have used text to columns to separate the time from the data, however cells such as A2-A4 leave behind a

What is date format of EEE, dd MMM yyyy HH:mm:ssZ? [duplicate]

梦想的初衷 提交于 2019-12-13 01:29:39
问题 This question already has answers here : How to parse date string to Date? [duplicate] (6 answers) Closed 4 years ago . I'm trying to parse this on Android: Fri, 02 Oct 2015 10:01:00+0300 with this format EEE, dd MMM yyyy HH:mm:ssZ , but doesn't work. item_date = "Fri, 02 Oct 2015 18:07:00+0300"; SimpleDateFormat curFormater = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ssZ"); Date dateObj = null; String newDateStr = item_date; try { dateObj = curFormater.parse(item_date); } catch

DCG for file output

梦想的初衷 提交于 2019-12-13 01:27:59
问题 If I have a program like this and I want the last item for a person not to have a comma following it, how do I do this? Is it best to use a DCG? How would that work? male(bob). male(dave). male(fred). male(dereck). likes(bob,cake). likes(bob, pie). likes(bob, apple). likes(dave, fish). likes(dave, meat). likes(dave, potato). likes(dave, pear). likes(fred, water). likes(fred, beer). likes(dereck, wine). likes(dereck, cake). print:- forall( male(Person), ( format("~w, ",[Person]), forall( likes

Setting custom format for numbers in TextView [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-12-13 01:27:37
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How do I format a number in java? String.format() to format double in java I want to be able to take the output from a double variable (called double) and put it in a TextView along with some String text (called outputPref, which just contains "cubic mm") like below displayAnswer.setText(volume + " " + outputPref); This works fine, however, the number shows in the TextView as the full double (with many, many

Output format in Jena Fuseki server

浪子不回头ぞ 提交于 2019-12-13 01:02:37
问题 Given this command: prefix dm: <http://one.example/> SELECT ?pID WHERE { ?pID dm:hasDName "xxxvvvII" . } The arq engine outputs the following: ------------------- | pID | =================== | dm:C002172 | ------------------- The fuseki server outputs the following: { "head": { "vars": [ "pID" ] } , "results": { "bindings": [ { "pID": { "type": "uri" , "value": "http://one.example/C002172" } } ] } } First question: how can I make the Fuseki server output the result in a more readable way with

make custom JTextField (JCurrencyField)

我的梦境 提交于 2019-12-13 00:52:52
问题 I making a JCurrencyField to use it in my program, I almost finished creating it but I've faced an issue. JCurrencyField is a normal JTextField but it cannot accept any character that is not a number or decimal point . and I made some specifications for this JCurrencyField: The user cannot insert more than one decimal point . . The user cannot insert more than two digits after the decimal point. The issue I've faced was not being able to insert any digits before the decimal point if there are

How to compare a date - String in the custom format “dd.MM.yyyy, HH:mm:ss” with another one?

冷暖自知 提交于 2019-12-13 00:22:03
问题 I have to check 2 date String s in the custom format "dd.MM.yyyy, HH:mm:ss" against each other. How can I get the older one? For example : String date1 = "05.02.2013, 13:38:14"; String date2 = "05.02.2013, 09:38:14"; Is there a way to get date2 with comparing? 回答1: You already have the date format, use it with SimpleDateFormat and then compare the created Date objects. See demo here. Sample code: public static void main(String[] args) Exception { String date1 = "05.02.2013, 13:38:14"; String