Re: Cygwin/Unix command - would like to export directory listing into txt file



Thanks Ed! I was actually opening up the actual txt file in Windows.
I just tried your suggestion, "cat theFiles.txt" and the new
lines/spaces are there! :D


Ed Morton wrote:
Lara wrote:

[please don't top-post]

It's fine for now! When opening the file in Excel, it automatically
put each listed file separately on a new line/row, so I can work with
this for now. :)

Thanks,
Lara


Lara wrote:

Hi again,

Alrighty, I just tried ls > theFiles.txt and it worked, however, there
is no space between the file names. Is there anyway to add a space, or
will it always produce output like this?

Thanks again in advance,
Lara

Lara wrote:

Hi all,

I'm quite new to Unix and am actually only using Cygwin on XP to get
the hang of things first, while also using it to practice compiling C
programs.

Now, I need a list of a directory's contents (containing a mix of .jpg
and .txt files, not that this would make a difference I assume!) and am
trying to figure out how to do it. :( All I've discovered is "ls"
(this is fine and shows everything), and "print" which actually doesn't
do too much for me except sit there spooling in my system tray (I tried
"print theFiles" and "print theFiles.txt"). "lpr" also doesn't do much
for me. Please note I have no printer attached and I would like to
transfer the text file's contents to a database, so I need it in txt
format if possible please.

Thanks in advance and sorry for the basic question,
Lara



Thank you for posting this riveting study of 8 minutes of your life... ;-).

I do wonder which command you used to view the contents of
"theFiles.txt" since apparently that command is neglecting to display
the newline characters used by "ls" between the file names. I suspect it
was some Windows thingy that, unlike UNIX tools, expects control-Ms
after each newline. Try the UNIX/cygwin command "cat theFiles.txt" and
you should see those "spaces".

Ed.

.



Relevant Pages

  • Re: cd mounting
    ... > bear with me a very new guy to linux(blows windows away) ... Do this on the command line: ... 'cat /etc/fstab' and copy & paste the output into your next posting. ...
    (linux.redhat.misc)
  • RE: re-setting boot partition
    ... Description of the Windows 2000 Recovery Console ... For a Microsoft Windows XP version of this article, ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ...
    (microsoft.public.win2000.setup_upgrade)
  • RE: Win2000 Upgrade to SP3 Express Setup error.
    ... Start your computer with the Windows Setup floppy disks, ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ... you cannot copy a file from the local hard disk to a floppy disk. ...
    (microsoft.public.win2000.setup_upgrade)
  • RE: Locating corrupt driver
    ... This article describes the functionality and limitations of the Windows ... Create and format partitions on drives. ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ...
    (microsoft.public.win2000.applications)
  • >>>> NET SEND <<<<
    ... Windows Xp Net Send ... Net Send Command For Mac ... Net Send Syntax Dos ... Dos Net Send Commands ...
    (sci.lang.japan)