InDesign 段落从 CSV 文件返回字符?

发布于 2024-11-04 06:03:39 字数 386 浏览 0 评论 0原文

我目前正在使用 ID CS4 的数据合并功能来导入从 MySQL 数据库导出的一些数据。虽然我可以设置 ID 来删除空行,但这并不总是适合我的目的,因为后面的行包含数据。结果,输出的数据中仍然出现空格。

由于我使用 PHP 生成 CSV 文件,所以我的问题是:我是否可以在 CSV 文件中指示 InDesign Paragraph Return 字符,以便可以按照我的意愿依次导入和显示数据。

例如,我尝试了以下示例,但似乎没有任何效果:

"code","description"
"12345", "Hardware\nTools"

"code","description"
"12345","Hardware \Z  Tools"

任何帮助将不胜感激!

I am currently using the Data Merge functions of ID CS4 to import some data I have exported from a MySQL database. Although I can set ID to remove blank lines, this doesn't always work for my purpose because later lines contain data. As a result, there still appears whitespace in the outputted data.

Since I am using PHP to produce the CSV file, my question is this: is it possible for me to indicate an InDesign Paragraph Return character within the CSV file, so that the data can then in turn be imported and displayed as I wish.

For example, I have the tried the following examples, but nothing seems to work:

"code","description"
"12345", "Hardware\nTools"

"code","description"
"12345","Hardware \Z  Tools"

Any help would be gratefully appreciated!

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

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

发布评论

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

评论(2

烟花易冷人易散 2024-11-11 06:03:39

不知道为什么第一个答案被接受,因为它是错误的。

谷歌仍然把这个线程放在第三位“数据合并设计换行符”,所以我想我必须给出一个真正的答案。

没有什么神奇的字符可以放入 CSV 文件中以在 InDesign 中自动生成换行符。

Adobe InDesign 帮助指定:

您不能在数据源文件的字段内插入换行符。如果需要将字段拆分为不同的行,请创建两个不同的字段,例如 <><>

如果您的行数是可变的,或者您不想仅为某些换行符创建额外的列,则只有一种解决方案:

  • 在 CSV 文件中,将换行符替换为某些特定字符 (¤< /code> 例如),它将充当行分隔符。
  • 然后,在 InDesign 中合并之后,使用“编辑”菜单中的“查找/替换”工具,找到“行分隔符”并将其替换回 InDesign 能够理解的换行符。

我希望这能够真正帮助那些像我一样在 InDesign 中遇到换行问题的人。

Not sure why the first answer was accepted, as it is wrong.

Google still brings this thread in third position for "data merge indesign line break", so I thought I had to give a real anwser.

There is no magical character you can put in your CSV file to automatically generate line breaks in InDesign.

The Adobe Help for InDesign specifies :

You cannot insert a line break within a field in the data source file. If it’s necessary to split a field across different lines, create two different fields, such as <<Address1>> and <<Address2>>.

If your number of lines is variable or if you don't want to create extra columns just for some line breaks, there is only one solution :

  • Replace, in your CSV file, the line breaks by some specific character (¤ for example) that would act as a line separator.
  • Then, after the merge in InDesign, use the Find/Replace tool in the Edit Menu, in order to find your "line separator" and replace it back to a line break, that InDesign will understand.

I hope this will really help those who struggled like me with these line breaks in InDesign.

偏爱自由 2024-11-11 06:03:39

根据此PDF,在IDML中您可以指定一个使用 进行“强制换行”,或者使用
强制进行“段落换行”。

我不确定这是否正是您正在寻找的,但您也许可以尝试一下。

希望这有帮助!

According to this PDF, in IDML you can specify a "forced line break" by using , or you can force a "Paragraph break" by using <br/>.

I'm not sure if this is exactly what you're looking for but you may be able to give it a try.

Hope this helps!

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