绕过以 + 开头的字段的 excel csv 公式转换或者 -

发布于 2024-10-07 05:18:10 字数 411 浏览 3 评论 0原文

我有一个 csv 文件,其内容为:

"x","y","-z"

当我导入它时,我得到:

alt text

如何绕过此转换?

更新

如果您尝试:

   "x","y",="-z,a"

“,a”不会被导入。

如果你在前面加一个空格:

   "x","y",=" -z"

或者

   "x","y"," -z"

它会正常工作

I have a csv file with contents:

"x","y","-z"

When I import it I get:

alt text

How can I bypass this conversion?

Update

If you try:

   "x","y",="-z,a"

The ",a" is not imported.

If you put a space in front:

   "x","y",=" -z"

or

   "x","y"," -z"

it will work fine

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

救赎№ 2024-10-14 05:18:10

在值前面加上等号

="x",="y",="-z"

Prefix the values with equals signs

="x",="y",="-z"
孤独患者 2024-10-14 05:18:10

您的问题是,通过使用 CSV 扩展,您将强制 excel 使用其非常严格的 CSV 约定来解释文件,这通常会违背您想要执行的操作,除非 CSV 文件最初是由 Excel 创建的。导入此 CSV 文件的最简单、最可靠的方法是将其重命名为 TXT 文件,然后使用 Excel 中的导入功能以您想要的方式强制列。

Your problem is that by using the CSV extension, you are forcing excel to interpret the file using its very strict CSV conventions, and this will often go against whatever it is you're trying to do unless the CSV file was originally created by Excel. Your easiest, and most reliable method of importing this CSV file, is to rename it to a TXT file, and then use the import function in excel to coerce columns in exactly the way you want.

奢欲 2024-10-14 05:18:10

使用Excel有完全的区别>导入并双击 .CSV 文件。使用不同的解析器。

根据上面的评论,我发现在“+”或“-”符号之前前置空格适用于双击 .CSV 文件的情况。所以我的文件现在包含例如

" +14";" -Foo"

There is a complete difference in using Excel > Import and double-click a .CSV file. Different parsers are used.

Based on the comments above, I figured out that prepending a space before a '+' or '-' sign works for the double-click .CSV file case. So my file now contains e.g.

" +14";" -Foo"
终止放荡 2024-10-14 05:18:10

我在 Excel 2003 中尝试了您的第一个示例,并且可以重现您的 #NAME 错误。

我的解决方案是打开文本文件并在导入向导(第 3 页)中将第三列指定为“文本”,同时选择正确的分隔符和文本限定符(第 2 页)。

无需对文本文件进行任何更改。

I tried your first example in Excel 2003 and could reproduce your #NAME eror.

My solution was to open the text file and to specify the 3rd column as "Text" in the import wizard (3rd page) - along with choosing the correct delimiter and text qualifier (2nd page).

No changes needed to the text file.

暗喜 2024-10-14 05:18:10

我更愿意在转换过程中直接解决这样的问题,通过给出正确的列格式,例如:对应包含操作符号的列使用 Text 格式:

列上的文本格式

检查此详细信息帖子:http://ask.osify.com/qa/854

I would prefer to solve such problem directly during the conversion, by giving the right column format, example: use Text format for the column that should contain operation sign:

Text format on the column

Check this detail post: http://ask.osify.com/qa/854

甩你一脸翔 2024-10-14 05:18:10

查找并替换每个实例
<代码>+

' +

开头的单引号和空格应取消任何 +-=

Find and replace every instance of
+
with
' +

A single quote and space at the beginning should cancel out any +, -, or =.

余生再见 2024-10-14 05:18:10

您还需要将 1.5 数字转换为 1,5 字符串,这样它们就不会更改为日期类型值。

对于 + - = 我使用空格方法“+....” - 不太好,但对于我的任务来说已经足够了。

You also will need to transform 1.5 numbers to 1,5 strings, so they don't changed to date type values.

For + - = I use space method " +...." - not great, but for my task was enough.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文