首页 \ 问答 \ 从Google文档电子表格粘贴时获取不一致的制表符分隔符宽度(Getting inconsistent tab delimiter width when pasting from Google docs spreadsheet)

从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
更新时间:2022-01-25 11:01

最满意答案

创建一个背景颜色为[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.

相关问答

更多
  • 当您锁定屏幕时,当前的iOS Cast SDK将断开套接字的连接,因此您目前无法实现该套接字。 The current iOS Cast SDK disconnects the socket when you lock your screen, so you cannot currently implement that.
  • 是的,许多应用程序有多个视图,听起来你应该考虑不止一个游戏。 实现多视图应用程序是一个多步骤的过程,我建议您按照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的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 ...
  • 就在这里。 您无法在锁定屏幕上更改内容。 Yes, there is. It is not possible for you to change something on lock screen.
  • 创建一个背景颜色为[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_ ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。