Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: how to indent output and redirect it to text file  (Read 2935 times)

0 Members and 1 Guest are viewing this topic.

nnf2540

  • Guest
how to indent output and redirect it to text file
« on: September 15, 2006, 05:32:22 PM »
I am trying to make the contents of a text file look nice, so some lines should be indented following the last line. I used the command [highlight]type names.txt  >> list.txt [/highlight] in a batch file, but the output is not what I want.

The display should look like:
[highlight]List of the students in Year 13:
         Alice
         Helen[/highlight]

How can I realize this function? Thank you.

                
« Last Edit: September 15, 2006, 06:59:14 PM by nnf2540 »

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: how to indent output and redirect it to text f
« Reply #1 on: September 16, 2006, 12:59:58 PM »
Quote
The display should look like:
List of the students in Year 13:
          Alice
          Helen

Quote
type names.txt  >> list.txt

What display? All you've done is redirected the output to another file. A space is just another character as far as the processor is concerned. What was the alignment in the names.txt file?

If this goes back to your other posts about more, then align the names.txt file using the space bar.

more >> names.txt
Code: [Select]
List of the students in Year 13:
        Alice
        Helen

Use the spacebar to insert the leading spaces in front of Alice and Helen or better yet use an editor such as EDIT or even EDLIN.

 8-)

Are you really running MS-DOS or just a look-alike under Windows?
« Last Edit: September 16, 2006, 01:03:56 PM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein