G*********a 发帖数: 1080 | 1 for StringTokenizor, i want to set up more than one delimiter in order to use
the this construcotor:
StringTokenizor st = new StringTokenizor (text, delimiter);
How should i include more than one element into this String delimiter?
String delimiter = ", ??? ."
Thanks. |
|
x***n 发帖数: 39 | 2 dont understand ur question.
if u want the string of ", ??? ." as the delimiter, since it's a string,
i don't see a problem;
if u want multiple delimiters, say ",", "???", ".", at least u can
replace the occurrences of any other delimiters into one same delimiter. |
|
d******9 发帖数: 404 | 3 Easy!
Just use infile:
Infile Fileref dlm=", /"
then SAS will treat both of them as delimiters.
Usually, if u use dlm="abc" then SAS regard each letter or any combination
of the 3 letters, a aa bb cc acb bca etc...as a delimiter. However, if you
use dlmstr="abc", then SAS only uses the STRING---abc-- as a delimiter. |
|
D*V 发帖数: 567 | 4 save as -> text(tab delimited) (*.txt) |
|
l***o 发帖数: 5337 | 5 有一个文件,里面有两种不同的delimiter, 一个是‘,’,一个是‘|’,请问该怎
么读进sas?
谢谢! |
|
|
c***s 发帖数: 70028 | 7 前总统马英九今天表示,常设仲裁法院认定太平岛是礁不是岛,他非常错愕与愤怒,绝不接受荒谬不公的国际仲裁,他呼吁政府立即提出具体措施,捍卫中华民国的太平岛。
马英九指出,这个法庭的存在,应该是为国际争端定纷息争、避免走上冲突甚至战争。但是,这样的仲裁结果,不但没有排难解纷,反而增加了冲突的可能。「在背後操控的势力,看似赢了面子,其实却输了裡子。」
「菲律宾对中国」南海仲裁案,常设仲裁法院今天公布结果,称中国大陆在9段线范围内主张的历史权利没有法律依据,而南沙群岛的所有海上地物,均为礁岩,包括太平岛在内。
马英九晚间在脸书发文表示,从去年12月到今年5月,包括他在内,150多名部会首长、国内外学者专家和国内外媒体,都访问太平岛,亲眼见证这个淡水充裕(南沙唯一)、农产丰富、生活机能完整的岛屿,完全符合「联合国海洋法公约」第121条关于「岛屿」必须「维持人类生存与自身经济生活」的要件。
他说,至今年4月底为止,也有430篇国际媒体完整陈述「太平岛是岛」的事实。太平岛是「岛」不是「礁」,已是国内外多数人的共识。
马英九指出,70年来,太平岛是在中华民国有效统治之下,对地区提供医疗救难等服务,夙有口... 阅读全帖 |
|
y*z 发帖数: 3244 | 8 The Hague, 12 July 2016
The Tribunal Renders Its Award
A unanimous Award has been issued today by the Tribunal constituted under
Annex VII to the United Nations Convention on the Law of the Sea (the “
Convention”) in the arbitration instituted by the Republic of the
Philippines against the People’s Republic of China.
This arbitration concerned the role of historic rights and the source of
maritime entitlements in the South China Sea, the status of certain maritime
features and the maritime enti... 阅读全帖 |
|
C****U 发帖数: 994 | 9 (非正式翻译)
南海仲裁案
(菲律宾共和国 v. 中华人民共和国)
海牙,2016年7月12日
仲裁庭发布裁决
今日,根据《联合国海洋法公约》(“《公约》”)附件七组成的仲裁庭就菲律宾共和国
对中华人民共和国提起的仲裁案作出了一致裁决。
该仲裁案涉及在南海的历史性权利的作用和海洋权利的渊源、某些岛礁的地位及其能够
产生的海洋权利,以及菲律宾声称违反了《公约》的中国某些行为的合法性问题。考虑
到《公约》对强制争端解决的限制性规定,仲裁庭强调,它既不对任何涉及陆地领土主
权的问题进行裁决,也不划定当事双方之间的任何边界。
中国反复申明“其不接受、不参与由菲律宾单方面提起的仲裁”。然而,《公约》附件
七规定,“争端一方缺席或不对案件进行辩护,应不妨碍程序的进行”。附件七同时规
定,在争端一方不参与程序的情况下,仲裁庭“必须不但查明对该争端确有管辖权,而
且查明所提要求在事实上和法庭上均确有根据”。因此,在整个程序中,仲裁庭采取了
一些步骤验证菲律宾诉求的正确性,包括要求菲律宾提交进一步的书面论证,在两次庭
审之前及庭审过程中对菲律宾进行询问,指定独立的专家就技术性问题向仲裁庭报告,
以及获取... 阅读全帖 |
|
H********g 发帖数: 43926 | 10 看这里:
http://docs.citationstyles.org/en/stable/primer.html
解释怎么写zotero的CSL。需要看的是Anatomy of an Independent Style部分。
其中这段似乎就是说在正文里的格式:
这是(author1,2014; author2,2015)
要改成 author1(2014),author2(2015)
把prefix改成空格“ ”,delimiter改成"),"
再把group delimiter 改成左括号
应该就差不多了。 |
|
s*********e 发帖数: 17 | 11 char * strtok( const char * string, const char * delimiters );
Sequentially truncate string if delimiter is found.
第一部分:
If string is not NULL, the function scans string for the first occurrence of
any character included in delimiters. If it is found, the function overwrites
the delimiter in string by a null-character and returns a pointer to the token
, i.e. the part of the scanned string previous to the delimiter.
第二部分:
After a first call to strtok, the function may be called with NULL as str |
|
N***m 发帖数: 4460 | 12 how about in java? tested a few cases and it seems to work.
Map map = new HashMap();
map.put("dog",1);
map.put("sheep",5);
map.put("cat",3);
String s = "dog-cat+dog-sheep";
List list = new LinkedList();
StringTokenizer st = new StringTokenizer(s, "+-");
while(st.hasMoreTokens()) {
St... 阅读全帖 |
|
p**o 发帖数: 3409 | 13 手写了一些C扩展,有些返回多重指针的函数不知道怎么用SWIG来包来供Python调用……
比如下面这个strsplit()函数,返回的是char**,怎么改才能让Python收到一个list (
of strings)?
http://www.swig.org/tutorial.html
我只是照tutorial简单地把函数声明抄进.i文件,Python中调用时返回的是
#include
#include
#include
/* Split an input string 'instr', using a set of given delimiters, to an
array of strings of at most 'maxparts' parts. */
char **strsplit (const char *instr, const char *delimiters, size_t maxparts)
{
char *... 阅读全帖 |
|
c****p 发帖数: 6474 | 14 #define DELIMITER '-'
void print_btree(node* root, const string path)
{
if (root == NULL)
return;
// Valid for single-letter named nodes;
string new_path = path + root->name;
// name delimiter needed otherwise
//string new_path = path + path.size()? DELIMITER : '' + root->name;
cout << new_path << ' ';
print_btree(root->left, new_path);
print_btree(root->right, new_path);
//return;
}
int main()
{
// create a btree rooted at btree_root;
print_btree(btr... 阅读全帖 |
|
s*****n 发帖数: 839 | 15 我的程序目的是把一个文件夹里面所有的csv file(4 columns each with same
variables)合并成一个文件。 总是得到IndexError: list index out of range
下面是我的程序:
import csv
import os
##this path is the location where raw data are stored
path = "C:/Users/Project/Python code/practice1/csv"
dirList=os.listdir(path)
##this fname is the output file name
fname = "C:/Users/Project/Python code/practice1/Combined file/combined.csv"
nfile = open(fname,'wb')
writer = csv.writer(nfile)
start = 0
for fn in dirList:
##this fullfn is the path for ... 阅读全帖 |
|
B*****g 发帖数: 34098 | 16 1. for such a big data, you should create tables yourself.
2. text file most time are Fixed Length or Delimited. Fixed Length, you know
the length of each filed. For delimited file fields length and type of
fields(both Fixed Length and Delimited), I think all (at least most)
software will decide based on data in the first data line(ignore header).
3. if the coming data is complete unknown, import to staging table first,
then....
4. Your company does not have BA?
columns |
|
|
c*****t 发帖数: 1879 | 18 其实你这个说难不难,说易不易。复杂点话,很大程度上,你这个问题类似
根据 DDL,然后 auto-generate marshalling/serializing/converting program 。
这个难度较大。另外一种是 interpretative 方法,也就是想办法设计你的
DDL 可以在 parse 该 DDL 的时候,chain 几个小的 converter (比如
run-length, delimited etc)一起。这个稍微容易一些。比如 DDL 是
对应的就是
parseRunLength (file, 10);
parseDelimited (",", true);
这个稍微容易一些。如果你没有写 compiler 的经验,可以考虑把这些
runlength / delimited 当作 java object (和对应 |
|
t*********n 发帖数: 278 | 19 I need to read a address book file. Each line is composed of street name,
city name, and extra. The problem is that the words in city name and street
name are seperated by space. I can not parse the line just by space
delimiter. I am thinking to use some special delimiter, like "|', to
seperate each field. Did C++ have some kind of building function to
automatically seperate the fields, which are broken by the delimiter. |
|
P********e 发帖数: 2610 | 20 sscan可以
I need to read a address book file. Each line is composed of street name,
city name, and extra. The problem is that the words in city name and street
name are seperated by space. I can not parse the line just by space
delimiter. I am thinking to use some special delimiter, like "|', to
seperate each field. Did C++ have some kind of building function to
automatically seperate the fields, which are broken by the delimiter. |
|
d****p 发帖数: 685 | 21 Using split generally is clean but not robust in this situation. Try "
ABABABAB": it returns 0.
This is because split functions treats the leading and trailing delimiters
differently. It ignores all trailing delimiters while insert an empty string
before the leading delimiter. |
|
h********o 发帖数: 103 | 22 CHAR变量 is your original variable.
SCAN(string,1,delimiter) is the Nth sub-string delimited by delimiter.
SCAN("01\21\2001",1,"") = 01
SCAN("01\21\2001",2,"") = 21
SCAN("01\21\2001",2,"") = 2001
The full code look like this
================================
DATA OLD;
INPUT CHAR : $10.;
CARDS;
3\3\1996
10\4\2006
10\20\2006
4\15\1997
13\15\1996
11789
;
DATA GOOD BAD(DROP = DATE);
SET OLD;
IF INDEX(CHAR,"") THEN DO;
MONTH = INPUT(SCAN(CHAR, 1, ""),$2.);
DAY = INPUT(SCAN(... 阅读全帖 |
|
l*******h 发帖数: 151 | 23 read.csv() is used to read CSV which is delimited by commas. read.table is
usually used to read raw data delimited by space. For your case, reading tab
delimited files, you can also try read.delim(..., sep="\t"). |
|
t*****w 发帖数: 254 | 24 write.csv in R to generate comma delimiter format data
write.table in R to generate tab delimiter format data
SAS can import comma or tab delimiter format data esily |
|
d*******y 发帖数: 349 | 25 楼主你的unix命令应该对的。你两个文件都sort了么?而且应该是sort by ID column
only. 两个文件的key都是unique的么
?而且你的命令缺省了delimiter,所以两个文件的delimiter都是space么?join 命令
default的delimiter是space, 不是tab。
结果你说有4000多列,所以missing了几万列的data? |
|
m******o 发帖数: 542 | 26 Chinese fishing vessels accidentally cut the cables of a Vietnam Oil & Gas
Group seismic ship doing work in Vietnam-controlled waters of the South
China Sea, Chief Executive Officer Do Van Hau.
“China cut the cables by accident,” he said by phone today. “It’s unlike
last time when they intentionally cut our cables.”
PetroTimes, a newspaper run by the company, quoted Pham Viet Dung, deputy
head of exploration, yesterday accusing the Chinese fishing vessels of “
harassing” the Binh Minh 2 survey s... 阅读全帖 |
|
d*b 发帖数: 4453 | 27 Doklam standoff: India refutes Chinese claims
洞郎对峙,印度否认中国说法,400人的驻军并没有减少,并将继续保持400人的兵力。
Continues to deploy 400 troops
NEW DELHI, AUGUST 2:
India continued to deploy around 400 troops along the tri-junction area atop
the Doklam Plateau as its military stand-off with China reached the 45th
day on Wednesday while the Chinese claimed India has reduced it to 40.
In a 15-page document released by the Chinese Foreign Ministry on Wednesday,
Beijing said on June 18, over 270 Indian soldiers, carrying w... 阅读全帖 |
|
t**********h 发帖数: 2273 | 28 gs
1.stack
2.linkedlist
3.linkedlist找圈圈 时间复杂度
4.给一本书,书是一个大string,输出每个char的freq
5.给一本书,书是一个大string,传一个string target进去,找target的freq a.考虑
delimit分割 b,不考虑delimit c.用过的char可以重用
6.上面都要分析复杂度
上次老邢白富美给我推荐了,拿了wb。这次还会不会给我wb捏? |
|
g*******e 发帖数: 156 | 29 搞定了
可能是日期的格式问题
先这样:
好像,在Excel裏面改到日期格式,可以選中要改的列,點
data
text to columns
original data type: delimited
delimiters: Tab
column data format: Date (choose MDY or any alternative fitting your data)
finish
然后排序就可以了 |
|
D***0 发帖数: 138 | 30 网上申请的,回复的挺快,安排了code challenge,一道题,不限时,半个小时写完了
,发过去,第二天收到了thank you but 88.不知道哪里的问题。
* Write a function that takes two parameters:
* (1) a String representing a text document and
* (2) an integer providing the number of items to return.
* Implement the function such that it returns a list of Strings ordered by
word frequency,
* the most frequently occurring word first.
* Use your best judgement to decide how words are separated.
* Your solution should run in O(n) time where n is the number of cha... 阅读全帖 |
|
l******9 发帖数: 579 | 31 I would like to load data from a txt file (9 KB) to SQL IBM netezza database
in Aginity workbench.
After creating the table:
I right-clicked the table and go to "import data" tab and chose "comma" as
field delimiter and skip the first row for the header in the file.
The SQL query is:
INSERT INTO username.my_table // the table has 12 columns and all are
characters
SELECT * FROM
EXTERNAL 'C:\mypath\my_file.txt'
USING
(
DELIMITER ','
LOGDIR 'C:\temp'
Y2BASE 2000
ENCODING 'internal'
SKIP... 阅读全帖 |
|
t*******r 发帖数: 22634 | 32 我刚才想了想,29 CFR 552.106 对于 29 USC 213(a)(15),理论上
似乎的确有一点点 challenge 的空间。虽然这个 challenge 的门槛很高。
这个一点点 challenge 的空间,是在于 babysitting 本身,涵盖了
从 0 - 12 岁。而在 0 - 12 岁这个范围,在 common sense 上,
USC 里的那句 “who (because of age or infirmity) are
unable to care for themselves”,程度差别很大。。。而且
USC 用 “age” 这个词,并没有限制于 elder,infant 也是 age。
(infirmity 靠不上,但是看 USC 的原文是 age OR infirmity。
所以单单 age 也够了)。
USC 后面还有一句 “(as such terms are defined and delimited
by regulations of the Secretary)”,似乎也给了空间争议
regulations (CFR) improperl... 阅读全帖 |
|
a******p 发帖数: 157 | 33 haha,谁让你上周不去钓鱼的,放鸽子损人品的:)发包子吧
数据库大牛,另外问个简单问题:有什么办法导出有binary 列的table数据, 还能还
原导入table 吗?
binary(16), 我觉得用指定的 delimiter 也没办法,因为binary(16)可以有binary
string=delimiter 的binary。 现在只能转换成hex然后再导入时转换回 |
|
f********t 发帖数: 74 | 34 During the import process, access will ask you what kind of delimiter is used in the
import file. In the same page, you can specify the double quote as field specifier (as long as in the double quote, it is one value even though there is delimiters in it). it will solve the problem. |
|
f******y 发帖数: 2971 | 35 新手想问一个store proc的问题。这个stored proc是这样的:
DELIMITER $$
CREATE DEFINER=`finalguy`@`inspiron` PROCEDURE `HolidaySelect`(HolidayDate
DATETIME)
begin
select HolidayDate, MicroHedgeIdentifier
from Holiday
where HolidayDate = @HolidayDate or @HolidayDate is null;
end $$
DELIMITER ;
我是这样调用的:
call HolidaySelect(null);
返回值是这样的:
null 1
null 2
null 3
...
所有的这些null都应该是日期的。大家能看出来错在哪儿吗?
谢谢。 |
|
f******y 发帖数: 2971 | 36 use Instrument;
delimiter //
create procedure HolidaySelect(h DATETIME)
begin
select `HolidayDate`, `MicroHedgeIdentifier`
from `Holiday`
where (`HolidayDate` = h or h is null);
end //
delimiter ;
这样就好了。 |
|
s**********o 发帖数: 14359 | 37 北京说的不错,其它办法都是穷糊弄,
SUBSTRING能搞定,QAS啥的靠啥赚钱啊
ADDRESS看似简单,但其实很复杂,
没有特定的规律,比如,
你不能假定是,DELIMITED或者SPACE DELIMITED
1629 Eleonora Dr. Eagle River, Michigan
可以有很多VALID的
1629 Eleonora Drive, Eagle River, Michigan
1629 Eleonora Dr, Eagle River, Michigan
1629 Eleonora Dr Eagle River Michigan
1629 Eleonora Eagle River, Michigan
1629 Eleonora Dr #2 Eagle River, Michigan
1629 Eleonora Dr Floor 1 Suite200 Eagle River, Michigan |
|
y*****g 发帖数: 677 | 38 You may need wrap your statements in a block of function/procedure like this:
delimiter $$
drop procedure if exists a;
create procedure a ()
begin
set @pretime = null;
if (@pretime is null) then
set @pretime := time(0);
end if;
select @pretime;
end $$
delimiter ; |
|
y*****g 发帖数: 677 | 39 You may need wrap your statements in a block of function/procedure like this:
delimiter $$
drop procedure if exists a;
create procedure a ()
begin
set @pretime = null;
if (@pretime is null) then
set @pretime := time(0);
end if;
select @pretime;
end $$
delimiter ; |
|
l******9 发帖数: 579 | 40 【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: error of importing data from txt file to IBM netezza SQL database
发信站: BBS 未名空间站 (Fri Nov 21 14:55:51 2014, 美东)
I would like to load data from a txt file (9 KB) to SQL IBM netezza database
in Aginity workbench.
After creating the table:
I right-clicked the table and go to "import data" tab and chose "comma" as
field delimiter and skip the first row for the header in the file.
The SQL query is:
INSERT INTO username.my_table... 阅读全帖 |
|
w*s 发帖数: 7227 | 41 say i have a txt file
line 1
line 2
# this is comment, no read
# comment 2
line 3
...
i start with
string all_stocks = System.IO.File.ReadAllText(FileName);
char[] delimiters = new char[] { ' ', 'r', 'n' };
string[] each_line = myClass.Split(delimiters,
StringSplitOptions.RemoveEmptyEntries);
how to skip comment lines pls ? |
|
l*****n 发帖数: 72 | 42 I get a very subtle question about regular expression in Perl.
for example, I have a data.txt like below:
440|34|56
44|33|56
441|23|56
442|31|56
443|30|56
0440|74|56
1441|53|56
2442|84|56
3443|92|56
The first field is the ID number.
for example, I need to find a line start exactly with ID=44, to avoid
finding some ID 440, 441, ... etc. I need to put delimiter "|" after the
ID. i.e., I am looking for a line starting with ID, and also ID
followed by delimiter "|".
1: $trackData = "data... 阅读全帖 |
|
c*******h 发帖数: 1096 | 43 不过不是对string用的,而是对file stream用的
getdelim只能有一个固定的delimiter,不够用啊。想要像strtok那样
可以指定一堆delimiter的。有这样的函数不? |
|
t****t 发帖数: 6806 | 44 m// can actually use arbitrary delimiter, as long as they match. in this
case, he apparently used "!" as delimiter. |
|
d****n 发帖数: 1637 | 45 #include //strtok_r
typedef struct{
char c1; char c2;int n1;int n2
}mystruct_t;
int parse_line(char * line, mystruct_t *s)
{
int counter=0;
char *workspace, *txt, *delimiter=",";
while((txt=strtok_r(!counter? line: NULL, delimiter, &workspace )))
{
if(counter==0){
assert(strlen(txt)==1);
s->c1=txt[0];
}
if(counter==1){
assert(strlen(txt)==1);
s->c2=txt[0];
}
if(... 阅读全帖 |
|
L***s 发帖数: 1148 | 46
python的默认str.split()是比较体贴的,
不论空几格,甚至是制表符,都按一个delimiter处理
In [10]: 'a b'.split()
Out[10]: ['a', 'b']
In [11]: 'a b'.split()
Out[11]: ['a', 'b']
In [13]: 'a b\tc'.split()
Out[13]: ['a', 'b', 'c']
楼主要区分空一格还是空两格,那么指定delimiter即可
In [12]: 'a b'.split(' ')
Out[12]: ['a', '', '', '', '', '', '', 'b'] |
|
l******9 发帖数: 579 | 47 【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: error of importing data from txt file to IBM netezza SQL database
发信站: BBS 未名空间站 (Fri Nov 21 14:55:51 2014, 美东)
I would like to load data from a txt file (9 KB) to SQL IBM netezza database
in Aginity workbench.
After creating the table:
I right-clicked the table and go to "import data" tab and chose "comma" as
field delimiter and skip the first row for the header in the file.
The SQL query is:
INSERT INTO username.my_table... 阅读全帖 |
|
D********g 发帖数: 30 | 48 用C++写个函数,实现一个从一个长字符串里面找到一组子字符串的功能,但是不是一
般的子串,长字符串是一串由","分隔开的数字,比如"12,34,-54,65,367,-123,-9,68,
", 然后我的函数的signature是:
string extractPartialString(const string& whole, int start, int end);
就是要找到在[start, end)之间的数字组成的子串。比如extractPartialString(input
, 2, 5)应该返回子串"-54,65,367"。我就是直接一个一个的按照分隔符","来找,找到
指定个数以后就返回,但是这样如果start很靠后的话会需要很长时间,毕竟要O(L+M)
的时间。不知道有没有什么更优化的算法可以实现这样的功能?请各位大牛支招,多谢!
以下是我目前的实现代码:
#include
#include
using namespace std;
/**
* Extract the partial string delimited by ... 阅读全帖 |
|
A*******e 发帖数: 108 | 49 \left和\right是用来自动调整delimiter大小的,后边跟点表示不需要delimiter |
|
v*****y 发帖数: 1087 | 50 如果是因为数字后面有多余的空格,或许可以用"text to column" ,delimited, 然后
选"space" 做delimiter 试试看。
。 |
|