Combining text for txt file

Hunlight

New Member
Joined
Sep 24, 2020
Messages
1
Platform
  1. Windows
Hello,

have an issue (knowledge based of course xD)

I got a txt file on daily basis with data similar to (some of text changed):



Number1|Number2|AMOUNT|
2025781827142860|202578182714286001|1110.00|
2024985596558806|202498559655880601|75.75|
2025781827142860|202578182714286001|1110.00|
2024985596558806|202498559655880601|75.75|
2025781827142860|202578182714286001|1110.00|
This one formatted as txt file so after importing (with vba script) into excel file, it pastes into A column, each row next line, Number1/A1, 22478* into A2 etc.

As well as additional data from a website, where I need to check the Status column its gonna be Column L in excel and depending on the status - success/ failed, accordingly add/modify above txt text.

In case of success then add second -
First row - ...Mount|TEXT1|REFUND_STATUS
Second row+ - ...00|Number3(cell C3+ from excel, with every line it paste text from next cell, C4,C5 etc)|REFUND_SUCCESS

In case of failed -
First row - same
Second row+ - ...00|| (double vertical line without any text or blanks no spaces)REFUND_FAILED

I tried playing with the regular stuff line =A2 & O5 , just combining lines, it works, but every line needs to be adjusted manually accordingly to the status which makes it irrelevant

I have VBA code that exports data from specific file to Excel sheet2 (data from the website is on sheet1), but still need to update it as it requires full file name which is different every day)

end result should be smth like:

Number1|Number2|AMOUNT|TEXT1|REFUND_STATUS
2025781827142860|202578182714286001|1110.00|1898786757577123|REFUND_SUCCESS
2024985596558806|202498559655880601|75.75|1898786757577123|REFUND_SUCCESS
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Watch MrExcel Video

Forum statistics

Threads
1,118,713
Messages
5,573,753
Members
412,550
Latest member
soking
Top