结合2个字段中的每隔一行 [英] Combine Every Other line from 2 fields

查看:51
本文介绍了结合2个字段中的每隔一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好专家!


我有两个字段,一个带歌词,另一个带和弦(用于创建和弦表)。我现在有:


Field 1:

你是我的阳光

我唯一的阳光

你让我开心

当天空是灰色的时候


场地2:


G

CG

G

D


我想:


G

你是我的阳光

CG

我唯一的阳光

G

你做的我快乐

D

当天空是灰色的时候


有谁知道我怎么能这样做。我不太了解VBA,但如果有人有示例代码,我绝对愿意尝试一下。我是一个快速学习者!


更新:

为了详细说明,似乎我需要一种能够找到每个回车的方法两个字段,并告诉它写每个其他字段的下一行,基于查找回车?我只是不知道该怎么做。可以使用SQL完成此操作,还是必需的VBA脚本。有人可以给我一个可能有用的示例代码吗?

解决方案

结果4记录是否带有Cr / Lf,或8个带有奇数记录的记录代表和弦和偶数记录代表歌词?

展开 | 选择 | Wrap | 行号


结果应该是现有记录中的单个字段,其中包含:


G

你是我的阳光

CG

我唯一的阳光

G
你让我开心

D

当天空是灰色的时候/>

如果在SQL中使用查询完成,那就没问题了。如果不能这样做,我希望能够告诉它只是在现有记录中创建一个新字段,它将记录中已存在的两个字段组合在一起,如上所示。 / blockquote>

  1. 查询定义(表名= tblTest):

    展开 | 选择 | Wrap | 行号

Hello Experts!

I have two fields, one with lyrics and one with chords (for chord sheet creation). I currently have:

Field 1:
You are my sunshine
My only sunshine
You make me happy
When skies are gray

Field 2:

G
C G
G
D

I want:

G
You are my Sunshine
C G
My only sunshine
G
You make me happy
D
When skies are gray

Does anyone have any idea how I can do this. I don''t know VBA very well but am definitely willing to try something out if someone has a sample code. I am a fast learner!

update:
To elaborate a bit, it seems that I need a way to be able to find every carriage return in the two fields, and tell it to write the next line from every other field, base on finding the carriage return? I just don''t know how to do this. Can this be done with SQL or is a VBA script necessary. Could someone give me a sample code that might work?

解决方案

Are the Results 4 Records with a Cr/Lf, or 8 Records with Odd Records representing Chords and Even Records representing Lyrics?

Expand|Select|Wrap|Line Numbers


The results should be a single field within the existing record containing:

G
You are my Sunshine
C G
My only sunshine
G
You make me happy
D
When skies are gray

It would be fine if this was done with a query in SQL. if that can''t be done, I''d like to be able to tell it to just create a new field within the existing record, that combines the two fields within that exist already within the record, as I show above.


  1. Query Definition (Table name = tblTest):

    Expand|Select|Wrap|Line Numbers


这篇关于结合2个字段中的每隔一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆