?
Solved

How do you add a space between the data when combining text files together?

Posted on 2014-09-12
6
Medium Priority
?
295 Views
Last Modified: 2014-09-18
How do you add a space between the end of the data and the start of data when combining text files?

For example:
copy *.txt newfile.txt

The result is that all the date is in succession one after another, and there are no spaces at all after the end of the data from the first text file and the beginning of the data in the next text file and so forth.

Is there a way to add this?
0
Comment
Question by:100questions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 52

Expert Comment

by:Vitor Montalvão
ID: 40319431
You made be remember my good days of DOS :)
Unfortunaly I couldn't find a way to add a space so my example is with a minus (-) character.
for %f in (*.txt) do copy /Y newfile.txt+%f newfile.txt & echo - >> newfile.txt

Open in new window

0
 
LVL 52

Expert Comment

by:Vitor Montalvão
ID: 40319461
New version. See if this one it's better for you (echo. instead of echo -):
for %f in (*.txt) do copy /Y newfile.txt+%f newfile.txt & echo. >> newfile.txt

Open in new window

0
 
LVL 13

Expert Comment

by:Gabriel Clifton
ID: 40319470
Try:
del merged.txt

for %%I in (*.txt) do (
    type %%I >> merged.tmp
    echo. >> merged.tmp
    echo. >> merged.tmp
)

ren merged.tmp merged.txt

Open in new window

0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 2000 total points
ID: 40319526
A useful one sometimes can be to use FIND with /v to exclude all but certain lines, if you specify "" then you end up with the whole file but with a nice delimeter between them with the filename:

find /v "" *.txt > new.log
type new.log

Open in new window


---------- 1.TXT
1

---------- 2.TXT
2

---------- 3.TXT
3

Open in new window


hth

Steve
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 40319528
And if you want just a blank line:

find /v "" *.txt | find /v "---------- "

Steve
0
 

Author Closing Comment

by:100questions
ID: 40330569
Thank you.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
By default the complete memory dump option is disabled in windows . If we want to enable the complete memory dump for a diagnostic purpose, we have a solution for it. here we are using the registry method to enable this.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question