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
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top