separator

awk: Preserve multiple field separators

大城市里の小女人 提交于 2019-12-24 06:45:56
问题 I'm using awk to swap fields in a filename using two different field separators. I want to know if it's possible to preserve both separators, '/' and '_', in the correct positions in the output. Example: I want to change this: /path/to/ example_file _123.txt into this: /path/to/ file_example _123.txt I've tried: awk -F "[/_]" '{ t=$3; $3=$4; $4=t;print}' file.txt but the field separators are missing from the output: path to file example 123.txt I've tried preserving the field separators: awk

Google Calculator Thousands Separator Special Character

跟風遠走 提交于 2019-12-24 01:15:40
问题 NOTE: For more answers related to this, please see Special Characters in Google Calculator I noticed when grabbing the return value for a Google Calculator calculation, the thousands place is separated by a rather odd character. It is not simply a space. Let's take the example of converting $4,000 USD to GBP. If you visit the following Google link: http://www.google.com/ig/calculator?hl=en&q=4000%20usd%20to%20gbp You'll note that the response is: {lhs: "4000 U.S. dollars",rhs: "2 497.81441

Ambiguous path separator on Windows - how to handle it?

别说谁变了你拦得住时间么 提交于 2019-12-23 10:35:06
问题 Another question brought up an interesting problem: On Windows, the Java File.pathSeparatorChar is ; , which is correct. However, the semicolon is actually also a valid character to folder or file names. You can create a folder named Test;Test1 on Windows. The question is: How would you determine whether the semicolon in a path list actually separates a path or is part of the directory name, if the path list can contain both absolute and relative paths? 回答1: If the path contains a ; itself

Ambiguous path separator on Windows - how to handle it?

雨燕双飞 提交于 2019-12-23 10:34:35
问题 Another question brought up an interesting problem: On Windows, the Java File.pathSeparatorChar is ; , which is correct. However, the semicolon is actually also a valid character to folder or file names. You can create a folder named Test;Test1 on Windows. The question is: How would you determine whether the semicolon in a path list actually separates a path or is part of the directory name, if the path list can contain both absolute and relative paths? 回答1: If the path contains a ; itself

WPF Separator position

北慕城南 提交于 2019-12-23 09:42:09
问题 I'm using a Separator to draw a vertical line inside a Border. At first this was ok because the line needed to be centered, but now I need to position it at a custom x-position from the left border. Is there a way to do that? <Border x:Name="border" ClipToBounds="True" Background="White" BorderBrush="Black" BorderThickness="2"> <Separator BorderBrush="Black" BorderThickness="2"> <Separator.LayoutTransform> <RotateTransform Angle="90" /> </Separator.LayoutTransform> </Separator> </Border> 回答1:

How to remove first cell top separator and last cell bottom separator

亡梦爱人 提交于 2019-12-22 05:21:28
问题 I need to remove top border form first cell in a particular section and bottom border form last cell in a particular section. I googled solution for complete hiding separators from tableView, but I'd like to avoid it. Also I've found solution when you get event when the cell will be displaying to play with separator insets. It works for middle separators, between two cells, but not for separator between header/footer and cell. Plus I've tried to see sublayers in the header, but since this

Separator between toolbar items in UIToolbar

梦想与她 提交于 2019-12-22 03:44:55
问题 How to add a separator between buttons in a UIToolbar? Sample image is shown in the below link 回答1: I can think of two ways : (a) You could make them very thin toolbar buttons with user interaction disabled. (b) Your other choice would be to implement your own toolbar. I'd try (a) first ;) 回答2: I did it with a custom view button, with a 1 pixel wide background: UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 1, 44)]; label.backgroundColor = [UIColor whiteColor];

Java CSV parser with string separator (multi-character)

谁说胖子不能爱 提交于 2019-12-22 03:23:14
问题 Is there any Java open source library that supports multi-character (i.e., String with length > 1) separators (delimiters) for CSV? By definition, CSV = Comma-Separated Values data with a single character (',') as the delimiter. However, many other single-character alternatives exist (e.g., tab), making CSV to stand for "Character-Separated Values" data (essentially, DSV: Delimiter-Separated Values data). Main Java open source libraries for CSV (e.g., OpenCSV) support virtually any character

Why they used ; to end statements in Java/C++

我是研究僧i 提交于 2019-12-22 00:34:39
问题 Should not they have used . to end a statement. They could use -> to call a method. Was this just a oversight? Or there is some deeper going on here? 回答1: Java picked the semicolon to have a syntax similar to C and C++. C++ picked it to have a syntax similar to C. And I would guess that C picked the semicolon because B, ALGOL and Pascal already used it, and there was no reason not to use an already accepted convention. 回答2: EDIT: see https://softwareengineering.stackexchange.com/questions

How to join lines adding a separator?

爷,独闯天下 提交于 2019-12-21 17:25:52
问题 The command J joins lines. The command gJ joins lines removing spaces Is there also a command to Join lines adding a separator between the lines? Example: Input : text other text more text text What I want to do: - select these 4 lines - if there are spaces at start and/or EOL remove them - join lines adding a separator '//' between them Output : text//other text//more text//text 回答1: You can use :substitute for that, matching on \n : :%s#\s*\n\s*#//#g However, this appends the separator at