从Google文档电子表格粘贴时获取不一致的制表符分隔符宽度(Getting inconsistent tab delimiter width when pasting from Google docs spreadsheet)
我正在尝试为某些人创建一个小工具,他们需要做的就是复制电子表格的内容,然后将其粘贴到文本框中,这将为他们嵌入文章创建一个很好的表格。
我设法做了所有事情,但Google文档在文本编辑器中复制和粘贴数据时,似乎在值之间得到了制表符分隔符的大小(宽度)错误。 所以,而不是得到4个默认空格,我在某些情况下得到2,到目前为止,我设法找出原因是一些单元格包含带空格的字符串。 出于某种原因,这似乎混淆了Google文档,从而提供了错误的间距,这反过来又毁了我的剧本。
我知道我可以在这里使用逗号分隔值,但问题是我们试图让人们能够简单地复制和粘贴。 请看下面的示例输出:
School Name Location Type No. eligible pupils
在此示例中,学校名称是一个单元格,位置是另一个单元格,类型是另一个,合格的学生是最后一个。 很明显,第一个细胞在右侧没有必要的空间。
有任何想法吗? 我考虑过将占用空间超过1的所有空格转换为逗号,但这可能会导致用户可能实际使用的情况2 ...这将无法再次使用。
I am trying to create a gadget for some people, where all they need to do is really copy the contents of a spreadsheet, then paste it in a textbox, which will in turn create a nice table for them to embed in their articles.
I managed to do everything, however Google docs, when copying and pasting data in a text editor, seems to get the size (width) of the tab delimiter wrong between values. So, instead of getting 4 spaces that is the default, i am getting 2 in some cases and so far i managed to find out that the reason is that some of the cells contain strings with spaces. For some reason, this seems to confuse Google docs, thus supplying wrong spacings, which in turn, ruin my script.
I know i can use comma separated values here, but the issue is we are trying to give people the ability to simply copy and paste. Look at the example output below:
School Name Location Type No. eligible pupils
In this example, School Name is one cell, Location is another, Type is another and No. eligible pupils is the last one. It is clear that the first cell does not have the necessary space on the right.
Any ideas? I thought about converting all blank spaces that take more than 1 space to commas, but this might lead to a situation users might actually use 2... which would not work again.
原文:https://stackoverflow.com/questions/34768881
最满意答案
创建一个背景颜色为
[UIColor blackColor]
的UIView
子类,并将该视图的alpha值设置为0.5。 当您将其作为子视图添加到您想要隐藏的任何视图时,它应该看起来大致类似于“断电”屏幕色调。添加一个按钮(完全alpha),它看起来超级光滑。
Create a
UIView
subclass that has a background color of[UIColor blackColor]
and set the alpha value for that view to 0.5. When you add it as a subview over whatever you view you want to obscure, it should look roughly like the "Power Down" screen tint.Add a button to that (at full alpha) and it'll look super slick.
相关问答
更多-
谷歌Chromecast iOS SDK是否支持锁屏控制?(Does google chromecast iOS SDK support lock screen controls?)[2023-01-12]
当您锁定屏幕时,当前的iOS Cast SDK将断开套接字的连接,因此您目前无法实现该套接字。 The current iOS Cast SDK disconnects the socket when you lock your screen, so you cannot currently implement that. -
iOS游戏都是一屏吗?(Are iOS Games all One Screen?)[2023-06-27]
是的,许多应用程序有多个视图,听起来你应该考虑不止一个游戏。 实现多视图应用程序是一个多步骤的过程,我建议您按照Apple iOS Developer教程进行操作。 https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/FirstTutorial.html Yes, many applications have multiple views and it sounds like you shoul ... -
绿屏/色度键iOS(Green screen / chroma key iOS)[2021-08-11]
编辑:链接坏了。 看起来该公司可能已经折叠。 这是一个(据称)支持iOS的Chroma Key包: https://tastyblowfish.com/chromagic/index.html 这是一个商业包 - 我与他们无关。 For those looking for an answer to this, I ended up using openCV. It's works great (for an iPhone app). Take a look at the source code in the ... -
我用这个: void EnableDlgItem (CWnd *dlg, int items[], BOOL bEnable) { int i = 0, item ; while ((item = items[i++]) != 0) { CWnd *pControl = dlg->GetDlgItem(item) ; if (pControl != NULL) pControl->EnableWindow(bEnable) ; } } ... 在一些CYo ...
-
IOS锁屏自定义文字(IOS lock screen custom text)[2022-09-23]
就在这里。 您无法在锁定屏幕上更改内容。 Yes, there is. It is not possible for you to change something on lock screen. -
ios灰屏(ios greying the screen)[2023-10-12]
创建一个背景颜色为[UIColor blackColor]的UIView子类,并将该视图的alpha值设置为0.5。 当您将其作为子视图添加到您想要隐藏的任何视图时,它应该看起来大致类似于“断电”屏幕色调。 添加一个按钮(完全alpha),它看起来超级光滑。 Create a UIView subclass that has a background color of [UIColor blackColor] and set the alpha value for that view to 0.5. Whe ... -
试着删除所有
然后尝试设置minimum ios version targeting try to remove for a moment all and then try to set the minimum ios version targeting -
试图缩小问题范围我发现它似乎与街景功能有关。 当我开始将mapview编码到我的应用程序中时,我将streetview功能设置为true: mapView.setStreetView(true); 当我关闭它(设置为假)时,灰色区域消失。 我还没有进一步调查这个,但是现在我的问题已经解决了(所以我写了这个作为答案)。 Trying to narrow down the problem I found that it seems to be related to the streetview feature ...
-
试试这个... // adding swipe gesture to your scrollview UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)]; // Set swipe direction. [swipeLeft setDirection:UISwipeGestureRecognizerDirecti ...
-
您写道: ...在网络请求发出时 UI更改必须在主线程上进行,因此您应该在后台线程上发出网络请求: self.user.enabled = false let bg_queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) dispatch_async(bg_queue, { // your network request here... dispatch_async(dispatch_get_main_ ...