gpt4 book ai didi

windows - 读取日志文件并获取列中的行而不是行

转载 作者:可可西里 更新时间:2023-11-01 10:46:21 28 4
gpt4 key购买 nike

有一个日志文件并希望将行读入 Excel 的单行列中。目前,它们成排堆叠。我想将 3 行反向堆叠为一行 3>2>1

FOR /F "delims=~" %%a in (svn.log)  echo %%a  
set col3 = %%a
echo col3 col2 col1

有没有简单的方法来做到这一点?

输入日志:>>>>

LINE#1 >r132852 | USERID | 2014-05-14 11:57:38 -0700 (Wed, 14 May 2014) | 3 lines
LINE#2 >>>Changed paths:
M /Customer/lag/inilib/ASIPS_4600.ini
M /Customer/lag/inilib/ASIPS_4600_TEXT_SEARCH.ini

LINE#3>> Connections tab in Plan Authoring and WO Execution.
LINE#4>> Ques ID: QUES-806

输出日志:>>>

LINE#4>> Ques ID: QUES-806 LINE#1 >>> r132852 | USERID | 2014-05-14 11:57:38 -0700 (Wed, 14 May 2014) | 3 lines LINE#2 >>>>Changed paths: M /Customer/lag/inilib/ASIPS_4600.ini M /Customer/lag/inilib/ASIPS_4600_TEXT_SEARCH.ini LINE#3 >>> Connections tab in Plan Authoring and WO Execution. ***

输出应该在列中的 1 条直线中

Input log:
------------------------------------------------------------------------
r132994 | Userid | 2014-05-19 06:22:51 -0700 (Mon, 19 May 2014) | 3 lines
Changed paths:
M /Customer/Company/IPS/lag/message/ASIPSI_MISSING_PAGE.sql
M /Customer/Company/IPS/lag/message/ASIPSI_MISSING_WORK_ORDER.sql
M /Customer/Company/IPS/lag/message/ASIPSI_MISSING_WORK_PLAN.sql

Added messages in try catch to display to the user in case objects do not exist any longer
Ques ID: ASIPS-1003
------------------------------------------------------------------------
r132960 | Userid | 2014-05-17 03:18:09 -0700 (Sat, 17 May 2014) | 3 lines
Changed paths:

modified the command on the product Nodes tab to display either the WO or the page
Ques ID: ASIPS-1003
------------------------------------------------------------------------
r132879 | Userid | 2014-05-15 01:18:32 -0700 (Thu, 15 May 2014) | 4 lines
Changed paths:
M /Customer/Company/IPS/lag/udvlib/ASIPSI_541CA51A7CCB439FB318B8482E380F78.sql

I have forgotten to remove the two buttons I have created for the merge PDF demo.

Ques ID: ASIPS-1003
------------------------------------------------------------------------
r132878 | Userid | 2014-05-15 01:05:10 -0700 (Thu, 15 May 2014) | 4 lines
Changed paths:
M /Customer/Company/IPS/lag/udvlib/ASIPSI_541CA51A7CCB439FB318B8482E380F78.sql

Correction of the Tag property for button [Display Object].

Ques ID: ASIPS-1003
------------------------------------------------------------------------
r132834 | Userid | 2014-05-14 09:05:13 -0700 (Wed, 14 May 2014) | 3 lines
Changed paths:
M /Customer/Company/IPS/lag/udvlib/ASIPSI_541CA51A7CCB439FB318B8482E380F78.sql

Display Object in Tab Page Nodes doesn’t display the work order when node type is KO.
Ques ID: ASIPS-1003

需要的输出:

Ques ID: ASIPS-1003,  
r132994 | Userid | 2014-05-19 06:22:51 -0700 (Mon, 19 May 2014) | 3 lines
Changed paths:
M /Customer/Company/IPS/lag/message/ASIPSI_MISSING_PAGE.sql
M /Customer/Company/IPS/lag/message/ASIPSI_MISSING_WORK_ORDER.sql
M /Customer/Company/IPS/lag/message/ASIPSI_MISSING_WORK_PLAN.sql

Added messages in try catch to display to the user in case objects do not exist any longer
------------------------------------------------------------
-------------------------------

以 QUES 开头的每一行都应该像以前一样在 CSV 文件中跨行,只是有多个修订版和 QUES ID

最佳答案

在示例文件上测试:

@echo off
< svn.log (
set /p a=
set /p b=
set /p c=
set /p d=
)

for %%a in ("%d%,%c%,%b%,%a%") do >newfile.csv echo %%~a
pause

关于windows - 读取日志文件并获取列中的行而不是行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23700347/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com