Attempting to copy a .csv to .txt

  • Thread starter Thread starter sakieboy
  • Start date Start date
S

sakieboy

I am attempting to Copy a .csv file to a text file. When
I use CopyFile or objFile.Copy it copies the file and the
same
number of bytes exists. When I do this manually, i.e.
single select the .csv file, right-click, open with
Wordpad, or Word, (I believe Notepad will give me the same
results as CopyFile), the number of bytes change, although
Windiff says "They are identical!!!", they actually are
not. I'm currently attempting to get some software that
checks hex comparisons between files, so that I can
differentiate between the files. The funny part about
this is that the "Manual save as" file that was created is
the one that works, and not the CopyFile. Any suggestions?
..
 
sakieboy: From a file content point of view, a txt file
is the same as a csv file. They contain nothing but text
and basic sentence punctuation, and tabs. CSV files are a
special case of txt files in that the fields are
delimited by commas, the text is not necessarily in
quotes, and each record is terminated by a CRLF. There is
no file header in either case. If you look at both files
using the DOS Debugger, you will see what I mean.

If you double click a small txt or csv file from Windows
Explorer (WE), the txt file will probably open in
Notepad. Use "Save As" to save it as a csv file. The csv
file on my system opens in Excel. If you right click the
csv file, you can use "open with" to select Notepad.
They will look the same and be the same.

This is one of the rare cases where you can change the
file extension using the rename function of WE to change
the extension from txt to csc and vice versa without
causing any damage or at a minimum, strange behavior.

That all said, I'm not sure what your problem is. It is
to say that you can rename a csv file to a txt file and
vice versa. I'm not quite sure how you do that within a
visual basic function call. I'll keep working on it and
let you know if I "discover" anything.

Ray
 
Back
Top