Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

List file names from a directory - Vietnames

  1. Jan 14, 2010 #1
    Hi everyone,

    I have a folder of Vietnamese songs (files). The file names are in Vietnamese.
    I used a VB6 program to create a list of file names and output them to MS-word.

    The program won't understand the Vietnamese characters, suc as ^, ., ~..., so it was represented by question marks (?) on the output.

    I am not a programmer (electrical instead). So I get stuck! Anybody please help?

    Thanks a lot and a lot!

    Sincerely,
    Mike

    PS: If I select one of the file names, copy and paste it to MS-word, it would be fine. The problem is that I cannot do it manually since there are many files.
     
  2. jcsd
  3. Jan 23, 2010 #2

    harborsparrow

    User Avatar
    Gold Member

    When doing the file I/O to read the file names, you might try using UTF-8 encoding instead of the default. I don't know how to do this in VB6 though.
     
  4. Jan 24, 2010 #3
    Not sure if it would work on Vietnamese characters but I know it works on some symbols...

    A quick and easy way I use to get a text list of all the file names from a folder (sometimes with symbols) is use the Windows command prompt.

    Fist click on 'Start' then 'Run' and type in 'cmd' and click 'OK' to open it.

    Lets say your list of songs is in this folder:
    C:\Songs

    1.) Type: 'cmd /u' (This makes your output in unicode if you have non-ascii characters to output)

    2.) Type: 'cd C:\Songs' (This takes you to the folder to output the file)

    3.) Type: 'dir C:\Songs > SongList.txt' (this outputs all the filenames in the folder 'C:\Songs' into a file called 'SongList.txt')

    Then in that folder, you will get a file called 'SongList.txt' that contains a list of every file in the folder 'C:\Songs'
     
  5. Jan 28, 2010 #4
    THANKS, x12179x!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook