Created
May 26, 2012 03:17
-
-
Save kuyseng/2791919 to your computer and use it in GitHub Desktop.
javascript: read from file as string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function build_string_from_name_page_file (name_page_file) { | |
var all_name_string = ""; | |
var tmp_arr = []; | |
var tmp_str = ""; | |
if(name_page_file !=null) { | |
all_name_string = "::"; | |
name_page_file.open("r"); | |
while(!name_page_file.eof){ | |
tmp_str = name_page_file.readln(); | |
tmp_arr = tmp_str.split("\t"); | |
if(tmp_arr.length == 2) { | |
all_name_string += ( tmp_arr[0] + "::" ); | |
}; | |
}; | |
name_page_file.close(); | |
}; | |
return all_name_string; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment