excel—在MS Office Suite中查找方法以分析文本文件输出
发布时间:2022-06-11 01:41:58 330
相关标签: # 数据# 脚本# 软件# 工具# 软件
目前使用的客户端记录保存系统位于较旧的纯文本系统(类似于DOS)中,但遇到了一个问题,即没有用于生成报告的真正GUI界面。为了生成报告,客户端记录数据被导出/转储为原始文本文件,没有特定的分隔符。
每个客户端记录有3个不同的屏幕(GENRL、PROFL、HSTRY),每个客户端/输入条目在数据转储上按顺序拉取这些屏幕。想想A1、A2、A3、B1、B2、B3等。这些屏幕中的每一个都主要是静态文本,界面中只有几个可编辑的选项。但是,没有选项仅导出数据转储中的这些特定可编辑值,因此包含全文。我想要的是能够获取其中一个原始文本文件,让系统查找特定的指示器/参考点,然后根据行的位置提取值。例如,如果系统查找;屏幕:";值等于;GENRL“;,然后,它应该查找IDCODE、DESCRIPTION、REGION字段,并在后面抓取-X-字符数,然后将这些字符存储在表/列中。一旦到达页面的末尾(由\uuuuuuuuuu行表示),它应该停止或触发脚本的另一部分。
尝试确定在MS Office工具套件中解析/过滤数据的方法。最初考虑使用Python脚本作为中介方法来对数据进行排序,但这需要我们的几个用户安装额外的软件,我们正试图避免这种情况。计划能够获取这些文件(一旦从主系统导出)并根据需要运行,因此寻找一个模板式解决方案(或power app),在那里我可以选择输入文件并运行该过程。理想情况下,最终的结果是一个power应用程序,员工上传输出文件,然后生成CSV。
示例输出文件
06/08/22 RECORD DISPLAY PAGE 1
YR 2022 QTR 2
SCREEN: GENRL
COMP: JDP1 GENERAL INFO
JOHN DOE PLUMBING
CLIENT ACTIVE DATE..... 01/01/2021
===============================================================================
IDCODE: JDP1 DESCRIPTION: JOHN DOE PLUMBING REGION: SW REP: STEVE
COMMENTS: blah blah blah STATUS: ACTIVE TERM DATE: N/A
RATE TYPE ( B-BOOK, N-NEGOTIATED ).... N PRICE EFFECTIVE .... 01/01/2021
INVOICING: M - MONTHLY -OR- Q - QUARTERLY ..... M
OPTIONS (M-MONOTONE, C-COLOR, D-DUALSIDED, I-IRREGULAR).... CDI
SPECIALS: OVERSIZED FREIGHT...... YES
REDUCED SHIPPING....... YES
REDUCED SERVICE FEE.... NO
______________________________________________________________________________
06/08/22 RECORD DISPLAY PAGE 2
YR 2022 QTR 2
SCREEN: HSTRY
COMP: JDP1 CLIENT ORDER HISTORY
JOHN DOE PLUMBING
IDCODE: JDP1 DESCRIPTION: JOHN DOE PLUMBING REGION: SW REP: STEVE
COMMENTS: blah blah blah STATUS: ACTIVE TERM DATE: N/A
OPTIONS: DISPLAY ARCHIVED ORDERS.... NO SHOW RETURNED ORDERS.... NO
SPECIAL COURIER ARRANGEMENTS IN PLACE................ NO
MULTIPLE DELIVERY METHODS............................ YES
MULTIPLE DELIVERY LOCATIONS.......................... NO
================ ORDER BREAKDOWN ============== ============ MODS ==========
LN DATE SKU PRICE QTY TOTAL LINE ADJUST REASON
-- ---------- ------- ------ - ----- ------- ---- ------ --------------
01 02/10/2021 7274952 14.95 * 7.0 104.65 03 -50.00 Svc Complaint
02 03/01/2021 7274118 3.50 * 10.0 35.00
03 03/17/2021 7273000 50.00 * 1.0 50.00
04
05
______________________________________________________________________________
06/08/22 RECORD DISPLAY PAGE 3
YR 2022 QTR 2
SCREEN: PROFL
COMP: JDB1 CLIENT PROFILE
JOHN DOE PLUMBING
IDCODE: JDP1 DESCRIPTION: JOHN DOE PLUMBING REGION: SW REP: STEVE
COMMENTS: blah blah blah STATUS: ACTIVE TERM DATE: N/A
IDENTIFIERS: =================================================================
REGION ZONE
001 SW AND METRO
-OR-
002 SW AND RIDGELINE
-OR-
003 N/A AND PARKLAND
______________________________________________________________________________
06/08/22 RECORD DISPLAY PAGE 4
YR 2022 QTR 2
SCREEN: GENRL
COMP: HCB1 GENERAL INFO
HAPPY CAT BAKERY
CLIENT ACTIVE DATE..... 10/01/2018
===============================================================================
IDCODE: HCB1 DESCRIPTION: HAPPY CAT BAKERY REGION: SW REP: RYAN
COMMENTS: tasty treats STATUS: TERMED TERM DATE: 09/30/2021
RATE TYPE ( B-BOOK, N-NEGOTIATED ).... B PRICE EFFECTIVE .... 10/01/2020
INVOICING: M - MONTHLY -OR- Q - QUARTERLY ..... Q
OPTIONS (M-MONOTONE, C-COLOR, D-DUALSIDED, I-IRREGULAR).... MCI
SPECIALS: OVERSIZED FREIGHT...... NO
REDUCED SHIPPING....... YES
REDUCED SERVICE FEE.... YES
______________________________________________________________________________ ```
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报