Guys, I'm actually almost done. Basically what I have to do is to read from file with a list of words, sort them alphabetically and write them into another file. I am almost done, but the only thing is, the assignment says that we shouldn't change the case of words, but I am changing everything to lowercase, because I'm using arrays to compare letters. So how can I keep the case? Or change everything to lowercase and then change the originals back after sorting, while writing? [code] #include<fstream> #include<iostream> #include<string> #include<cstdlib> using namespace std; int main() { ifstream inFile, inSortFile; …

Member Avatar
Member Avatar
+0 forum 10

I want to build a script that does the following: The script should do make an arry from the directory where the script is with os.listdir(). Then the script has to test if the value in the array already excists in the outcome file, if not the name in the array should be written to the file alphabetically. For example: array=['test123','hallo','ABC','zipcode','myname','computer','test456'] The outcome in my file should be: ABC computer hallo myname test123 test456 zipcode Could anyone please help me to make a script like this? I already started making this: But the problem with this is. That everything is …

Member Avatar
Member Avatar
+0 forum 2

hey all, im new at shell scripting and need to find out a simple way to create text files, with random words in them. then needing to input 3 of these files arranging their lines in alphabetical order and after that creating an output file with the last lines sorted in reverse alphabetical order. i really am a beginner so could you please explain as you help. thanks in advance

Member Avatar
Member Avatar
+1 forum 9

I have a large amount of items stored in my DB (around 3,000 total and growing) and I have a list of them sorted alphabetically that displays on a page. I was interested; however, in having the items display in blocks instead that look something like: [INDENT][B]A[/B] [All items that start with the letter A] [B]B[/B] [All items that start with the letter B] [B]C[/B] [All items that start with the letter C][/INDENT] How would I go about doing this in PHP or is it even possible?

Member Avatar
Member Avatar
+0 forum 10

I'm reading the filenames/directories of all the files within a folder into an array of Files. The filesnames are all of the type: Name1, Name2, Name3, Name4, Name5, Name6, Name7, Name8, Name9, Name10, Name11, Name12, Name13 The above shows the correct order in which the files [B]should[/B] be ordered. However, what java does is the following: Name1, Name10, Name11, Name12, Name13, Name2, Name3, Name4, Name5, Name6, Name7, Name8, Name9 Here is the code I used: [CODE]JFileChooser folderChooser = new JFileChooser(); folderChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int returnVal = folderChooser.showOpenDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { File directory = folderChooser.getSelectedFile(); File files[] = directory.listFiles(); Arrays.sort(files); } …

Member Avatar
Member Avatar
+0 forum 3

Hi, I am trying to make a simple php photo gallery, I have this code, but the only problem is that the photos appear in a random order. How can I get the photos to appear alphabetically or numerically? [CODE]<?php if ($handle = opendir('photos/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $photos .= ' <img src="thumbs.php?src='.$file.'&f=2&t=3" alt="'.$file.'" title="'.$file.'"/> '; } } closedir($handle); } ?> <?php print $photos; ?>[/CODE] Thank you

Member Avatar
Member Avatar
+0 forum 7

The End.