简体   繁体   English

是否可以在Sublime Text 2中轻松合并这样的两个文件?

[英]is it possible to easily merge two files like this in Sublime Text 2?

I have two files, the first one contains this: 我有两个文件,第一个包含这个:

companyName
url
country
address
zip
founders
industry
isPrivate

and the second one contains this: 第二个包含这个:

:companyName
:url
:country
:address
:zip
:founders
:industry
:isPrivate

Is it possible to easily merge the contents of the second file into the first one so it looks like this: 是否可以轻松地将第二个文件的内容合并到第一个文件中,所以它看起来像这样:

companyName   :companyName
url           :url
country       :country
address       :address
zip           :zip
founders      :founders
industry      :industry
isPrivate     :isPrivate

Well, that depends on what you mean with easily merge . 那么,这取决于您easily merge含义。 The way I'd go about to do it would be the following: 我打算这样做的方式如下:

In the file with the commas, place the cursor at the beginning of the first line, hold alt+shift and press the down-arrow key until you reach the last line, this enables multiple cursors. 在带逗号的文件中,将光标放在第一行的开头,按住alt+shift并按向下箭头键,直到到达最后一行,这将启用多个游标。

Press shift+end so that you mark all the contents on each line. shift+end以便标记每行的所有内容。 Press ctrl+c to copy. ctrl+c进行复制。

In the other file repeat the first procedure, enabling multiple cursors, but do not copy, instead press end so that you get the cursors to the end of each line, press tab or space to get most of the lines where you want them and then press ctrl+v . 在另一个文件中重复第一个过程,启用多个游标,但不要复制,而是按下end这样你就可以将光标移到每一行的末尾,按tabspace以获得你想要的大部分行,然后按ctrl+v

Finally you'll need to fix some of the lines like the one containing zip . 最后你需要修复一些包含zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM