Summary: Unless there is a way to 'Save as' from Excel to this format, I want to click on a script that modifies a text file by replacing all CRLF (Carriage Return Line Feeds) with CR and after that replaces all LF with CRLF.
Situation: I have an Excel file that I save as a Tab Delimited Text file [Text (Tab delimited) (*.txt)]. I then import that text file into TimeSlips. Example text in linked image to show line breaks.
For the import to correctly import the description data with line breaks, I need to first open the text file in Notepad++ and replace all the line breaks as mentioned above.
I must replace the CRLF with CR before replacing the LF because if I find/replace LF first, it will alter the CRLF to CRCRLF.
I'm a novice at scripts. I looked at some examples of this and couldn't really wrap my head around what I found.
Like:
@echo off
setlocal EnableDelayedExpansion
set LF=^
%Don't remove%
%these lines%
set "EOL=!LF!" & set "EOL2=!LF!"
for /F %%a in (test.txt) do (
if %%a equ PROP-SUMMARY set "EOL=!LF!"
set /P "=%%a!EOL!" < NUL
set "EOL0=!EOL!" & set "EOL=!EOL2!" & set "EOL2=!EOL0!"
if %%a equ PROP-VALUES set "EOL=,"
)
from: I want to replace carriage returns with commas in batch
Test Data: enter image description here
I created a PowerShell Script that works nicely.
And I'm now working on an Excel VBA macro. :/