Help with asl files (Apple Script Logs)
I went through my hard drive recently using a program called GrandPerspective. It showed me that i had this huge chunk of files thats taking up almost a quarter of my 232 GB hard drive.
I did some google searching and found out that they are logs of what the computer did that day. Because most of the threads were from 2005-2009, I wasn't sure if that information was outdated or not.
So my main question is this. Can I delete these asl files without doing harm to my MacBook?
If you need more info to answerer this, please ask! Thanks in advance!
I went through my hard drive recently using a program called GrandPerspective. It showed me that i had this huge chunk of files thats taking up almost a quarter of my 232 GB hard drive.
I did some google searching and found out that they are logs of what the computer did that day. Because most of the threads were from 2005-2009, I wasn't sure if that information was outdated or not.
So my main question is this. Can I delete these asl files without doing harm to my MacBook?
If you need more info to answerer this, please ask! Thanks in advance!
Similar Messages
-
Help with selecting files from script menu or drag and drop
I found this scale images applescript online. It works great when a bunch of files is dragged on top of the script but I would like it to also work when a folder or group of files is selected in the Finder and I activate it from the scripts menu.
I can't get my on run statement to work. I'm not really an Applescript guy so I'm really just asking if someone can help finish what I started in this on run.
-- save in Script Editor as Application
-- drag files to its icon in Finder
property target_width : 120
property save_folder : ""
on run
tell application "Finder"
activate
set folder_path to quoted form of (POSIX path of (the selection as alias))
set theItems to every file of folder_path
end tell
end run
on open some_items
-- do some set up
tell application "Finder"
-- get the target width, the default answer is the property target_width
set new_width to text returned of ¬
(display dialog "Target width:" default answer target_width ¬
buttons {"OK"} default button "OK")
if new_width as integer > 0 then
set target_width to new_width
end if
-- if the save_folder property has not been set,
-- set it to the folder containing the original image
if save_folder is "" then
set save_folder to ¬
(container of file (item 1 of some_items) as string)
end if
-- get the folder to save the scaled images in,
-- default folder is the property save_folder
set temp_folder to ¬
choose folder with prompt ¬
"Save scaled images in:" default location alias save_folder
set save_folder to temp_folder as string
end tell
-- loop through the images, scale them and save them
repeat with this_item in some_items
try
rescaleand_save(thisitem)
end try
end repeat
tell application "Image Events" to quit
end open
on rescaleand_save(thisitem)
tell application "Finder"
set new_item to save_folder & "scaled." & (name of this_item)
end tell
tell application "Image Events"
launch
-- open the image file
set this_image to open this_item
set typ to this_image's file type
copy dimensions of this_image to {current_width, current_height}
scale this_image by factor (target_width / current_width)
save this_image in new_item as typ
end tell
end rescaleandsaveWhen items are dragged to your script's icon they are passed in to the on open handler, so this triggers:
on open some_items
and the dragged items are passed in as some_items
In contrast, when you double-click on the script, or invoke it via the Script menu, this runs the on run handler:
on run
tell application "Finder"
activate
folder_path to quoted form of (POSIX path of (the selection as alias))
set theItems to every file of folder_path
end tell
end run
However, there's nothing in this block that actually does anything with the selection - you (dangerously) assume that the selection is a folder (you really should check first), and just set theItems to every file in that folder then you exit.
So to do what you want you'll need to edit your run handler to filter the selection and pass files over to the code that does the hard work.
You already have the basis for this - your rescaleandsave() handler, so it's just a matter of identifying the files in the selection and passing those over to that handler:
on run
tell application "Finder"
set cur_selection to (get selection) -- get the selection
repeat with each_item in cur_selection -- iterate through
if class of each_item is folder then -- do we have a folder?
set theFiles to every file of each_item -- if so, get its contents
repeat with each_file in theFiles -- iterate through them
my rescaleand_save(eachfile) -- and process them
end repeat
else if class of each_item is document file then -- do we have a file selected?
my rescaleand_save(eachitem) -- if so, process it
end if
end repeat
end tell
end run
So the idea here is that the run handler gets the selection and works through the (potentially-numerous) items. For each selected item it checks whether its a folder or a file, if its a folder it gets all the files within and passes them to the rescaleandsave handler.
Note that this is not recursive - it won't catch files within folders within folders - since it only looks at the top level of selected folders, but it wouldn't be hard to rework the script to handle that if that's what you need. -
Help with add file name problem with Photoshop CS4
Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
Script follows:
// this script is another variation of the script addTimeStamp.js that is installed with PS7
//Check if a document is open
if ( documents.length > 0 )
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.INCHES;
try
var docRef = activeDocument;
// Create a text layer at the front
var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.TEXT;
myLayerRef.name = "Filename";
var myTextRef = myLayerRef.textItem;
//Set your parameters below this line
//If you wish to show the file extension, change the n to y in the line below, if not use n.
var ShowExtension = "n";
// Insert any text to appear before the filename, such as your name and copyright info between the quotes.
//If you do not want extra text, delete between the quotes (but leave the quotes in).
var TextBefore = "Lower© ";
// Insert any text to appear after the filename between the quotes.
//If you do not want extra text, delete between the quotes (but leave the quotes in).
var TextAfter = " ";
// Set font size in Points
myTextRef.size = 10;
//Set font - use GetFontName.jsx to get exact name
myTextRef.font = "Arial";
//Set text colour in RGB values
var newColor = new SolidColor();
newColor.rgb.red = 0;
newColor.rgb.green = 0;
newColor.rgb.blue = 0;
myTextRef.color = newColor;
// Set the position of the text - percentages from left first, then from top.
myTextRef.position = new Array( 10, 99);
// Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
myLayerRef.blendMode = BlendMode.NORMAL;
// select opacity in percentage
myLayerRef.opacity = 100;
// The following code strips the extension and writes tha text layer. fname = file name only
di=(docRef.name).indexOf(".");
fname = (docRef.name).substr(0, di);
//use extension if set
if ( ShowExtension == "y" )
fname = docRef.name
myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
catch( e )
// An error occurred. Restore ruler units, then propagate the error back
// to the user
preferences.rulerUnits = originalRulerUnits;
throw e;
// Everything went Ok. Restore ruler units
preferences.rulerUnits = originalRulerUnits;
else
alert( "You must have a document open to add the filename!" );you might want to try the scripting forum howard:
http://www.adobeforums.com/webx?13@@.ef7f2cb -
Can some help with CR2 files ,Ican`t see CR2 files in adobe bridge
can some help with CR2 files ,I can`t see CR2 files in adobe bridge when I open Adobe Photoshop cs5- help- about plugins- no camera raw plugins. When i go Edit- preference and click on camera raw shows message that Adobe camera raw plugin cannot be found
That's strage. Seems that the Camera Raw.8bi file has been moved to different location or has gone corrupt. By any chance did you try to move the camera raw plugin to a custom location?
Go To "C:\Program Files (x86)\Common Files\Adobe\Plug-Ins\CS5\File Formats" and look for Camera Raw.8bi file.
If you have that file there, try to download the updated camera raw plugin from the below location.
http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5371&fileID=5001
In case you ae not able to locate the Camera Raw.8bi file on the above location, then i think you need to re-install PS CS5.
[Moving the discussion to Photoshop General Discussions Forum] -
Please help!! Using Apple Script in Automator for Quicktime
I would like to add some metadata to a batch of quicktime movies and then make the files unable to be altered and re-saved so that I can post them on the web. If I open a movie in quicktime and run the following apple script I can then perform save as of movie A into movie B and movie B cannot be altered.
tell application "QuickTime Player"
set saveable of movie 1 to false
-- save self contained
end tell
I would love to be able to do this on a batch level in automator however I cannot figure out how to pass automator items to the apple script so that their saveable can be set to false, and after this I cannot figure out how to have to movies re-saved so the changes will take effect.
Any help at all would be greatly appreciated.how are you passing files to apple script? as finder items?
the following should work then
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
on run {input, parameters}
tell application "Finder"
repeat with cur_file in input
set fname to (name of (get info for cur_file) as text)
tell application "QuickTime Player"
open file (cur_file as text)
set saveable of document 1 to false
tell application "Finder" to set new_item to (path to desktop as string) & fname
save self contained document 1 in new_item
delay 1
close document 1
end tell
end repeat
end tell
end run
</pre>
the above will dump the modified files onto your desktop and give them the same names they had before. You can adjust that as you like of course. -
I'm having problems copying data across my network to my new mac mini and i'm looking for some help with how to resolve this issue.
I'm using "Connect to Server' to connect via SMB to a Vista x64 machine that has the files I need to copy. I'm mounting the share as the user that has permissions to the files on the vista client. The connection is fine, but when I start the copy process, I receive an error message about not having the appropriate permissions to copy files and then the entire copy process fails. Here is the exact error message:
Copy
The operation cannot be completed because you do not have sufficient privileges for some of the items.
OK
From the vista machine I have logged in as the same user and I have taken ownership of ALL of the files and folders I'm trying to copy. I also made sure that the folder is shared with EVERYONE having full access (not something I would normally do, but figured it might help this situation). The vista machine is in a workgroup if that makes a difference.
Question 1: how can I do this via command line so that instead of stopping the entire file copy it skips the ones it can't copy and copies the rest of them?
With hundreds of subfolders and thousands of files, I have no idea which ones it is failing to copy making this process quite painful.
I'm also stuck on another basic issue - when I originally connected to the share, I told the OSX machine to remember the password. If I want to reconnect to the share using a different username and different password, how do I get OSX to reprompt me for this information?
HelpYou are probably better off using
ditto
In a terminal
man ditto
and read the description and instructions.
Yes, sadly, many copy process when the fail at a file abort the rest of the process. Windows does this as well. -
Help with .txt files importing / showing
I am working cs4. / as 3.0
I need some help understanding placing text with .txt files.
I have a txt & css file in my site folder.
Do I need to add a line to my script to locate the files in
my site folder?
Any help would be appreciated. thanks
Here is what I have so far.
var fileTxt:String;
var myTextLoader:URLLoader = new URLLoader();
var cssLoader:URLLoader = new URLLoader();
myTextLoader.addEventListener(Event.COMPLETE, onloaded);
myTextLoader.load(new URLRequest("textInfo.txt"));
function onLoaded(e:Event):void {
fileTxt=myTextLoader.data;
callCss();
function callCss():void {
var cssRequest:URLRequest=new URLRequest("stylesSite.css");
cssLoader.addEventListener(Event.COMPLETE, onCss);
cssLoader.load(cssRequest);
function onCss(e:Event):void {
var css:StyleSheet = new StyleSheet();
css.parseCSS(cssLoader.data);
infoText.styleSheet=css;
infoText.wordWrap=true;
infoText.htmlText=fileTxt;
infoScroll.update();Thanks for the information. Am I missing something or you forgot to actually post a question?
What are the problems you have? What have you tried and how did not it work?
Mike -
Hi,
I have installed the Flip4Mac in order for me to play windows media player files.It seems to work ok but I need help with one specific file.
I am trying to play a wmv file from a CD and it opens Quicktime with audio but not video. Any ideas?
Thanks.
Macbook C2D Mac OS X (10.4.8)Chances are the file is a WM v10 or 11 file, which cannot be played on a Mac.
However since Flip4Mac is not an Apple product, I suggest you post your question on Flip4Mac forums:
http://www.flip4mac.com/fusetalk/forum/ -
[SOLVED] Need a little help with ACPI handler.sh script.
By using ACPI I'm trying to get my laptop to hibernate at critical power state. So far I've made a few test scripts to test how to do this, with one of these scripts I'm stuck. My scripting skills are not that good to solve it.
This is the script:
if [ `awk '{print $3}' /proc/acpi/battery/C1E9/state` == "ok" ]
then
logger "battery is ok"
else
logger "battery is not ok"
fi
If I run the script I get an error (while "battery is not ok" is logged):
┌─[~]
└─> ./test2
./test2: line 1: [: too many arguments
┌─[~]
└─>
When I run the awk-command from the script, I get the following output:
┌─[~]
└─> awk '{print $3}' /proc/acpi/battery/C1E9/state
ok
discharging
2341
1824
10969
┌─[~]
└─>
I think the problem lies in the multiple output of the awk-command, but I'm stuck in solving it.
Any help would be great.
Last edited by NeoXP (2009-11-16 22:40:45)@ skanky
Thanks for the suggestion, but you're right I'm not gonna change a working script. It is working exactly as expected.
@ all
When interested this is my current handler.sh
#!/bin/sh
# Default acpi script that takes an entry for all actions
# NOTE: This is a 2.6-centric script. If you use 2.4.x, you'll have to
# modify it to not use /sys
minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
set $*
case "$1" in
button/power)
echo "PowerButton pressed!">/dev/tty5
case "$2" in
PWRF) logger "PowerButton pressed: $2" ;;
*) logger "ACPI action undefined: $2" ;;
esac
button/sleep)
case "$2" in
SLPB) echo -n mem >/sys/power/state ;;
*) logger "ACPI action undefined: $2" ;;
esac
ac_adapter)
case "$2" in
AC)
case "$4" in
00000000)
echo -n $minspeed >$setspeed
#/etc/laptop-mode/laptop-mode start
00000001)
echo -n $maxspeed >$setspeed
#/etc/laptop-mode/laptop-mode stop
esac
*) logger "ACPI action undefined: $2" ;;
esac
battery)
if [ `awk '{print $2}' /proc/acpi/ac_adapter/C1E8/state` == "off-line" ];
then
logger "battery discharging"
if (( `awk '{if (NR==5) {print $3}}' /proc/acpi/battery/C1E9/state` >= "250" ))
then
logger "battery ok"
else
logger "battery not ok"
/usr/sbin/pm-hibernate;
fi
else logger "battery charging"
fi
button/lid)
if [ `awk '{print $2}' /proc/acpi/button/lid/C1ED/state` == "closed" ];
then
logger "ACPI lid closed"
/usr/sbin/pm-suspend
fi
logger "ACPI group/action undefined: $1 / $2"
esac
Still working on it though -
Hello everyone, hoping for some help with my new Apple Cinema Display 20"
Hi everyone, I bought an Apple Cinema Display 20 inch LCD monitor, just about 3 weeks ago. I have two issues I am hoping to get some help with.
1) I am using the screen on a PC with Windows XP, and I was very disappointed at the lack of PC support. I have no on screen display (OSD), so I can't see what percentage I have my brightness set to, and I can't alter the colour or contrast of the display, etc. Luckily it defaulted to very good settings, but I would really like to be able to use the (fan made?) program called "WinACD". If I would be best asking somewhere else, please direct me there. If not, my problem is that I installed it added the "Controls" tab, but it just says, Virtual Control Panel "None Present". I have tried googling for an answer, and I have seen many suggestions, but none of them worked. I installed the WinACD driver without my USB lead plugged in, and someone said that was important. So I have tried uninstalling, rebooting, then reinstalling it again with the USB plugged in, and a device plugged in to my monitor to be sure. It didn't seem to help. I have actually done this process a few times, just to be sure. So I would really like to get that working if possible.
2) I am disappointed at the uniformity of the colour on the display. I have seen other people mention this (again, after a google search), and that someone seemed to think it is just an issue we have to deal with, with this generation of LCD monitors. Before I bought this screen, I had an NEC (20wgx2), and it had a very similar issue. Most of the time, you cannot see any problem at all, but if you display an entire screen with a dark (none prime) colour, like a dark blue green colour, you can see areas where it is slightly darker than others. It was more defined on the NEC screen, and that is why I returned it. I now bought this Apple Cinema Display, because it was the only good alternative to the NEC. (It has an 8bit S-IPS / AS-IPS panel, which was important to me). But the problem exists in this screen too. It isn't as bad thankfully, but it still exists... I have actually tried a third monitor just to be sure, and the problem existed very slightly in that one, so I think I am probably quite sensitive in that I can detect it.
It is most noticable to me, because I do everything on this PC. I work, I watch films, and I play games. 99% of the time, I cannot see this problem. But in some games (especially one)... the problem is quite noticeable. When you pan the view around, my eyes are drawn to the slight areas on my screen which are darker, and it ruins my enjoyment. To confirm it wasn't just the game, like I said, I can use a program to make the entire screen display one solid colour, and if you pick the right type of colour (anything that isn't a bright primary colour), I can see the problem - albeit fairly faintly.
I am pretty positive that it is not my graphics card or any other component of my PC, by the way, because everything is brand new and working perfectly, and the graphics card specifically, I have upgraded and yet the problem remains - even on the new card. Also, the areas that are darker, are different on this screen than on the other screens I have used.
So basically, I would like to register my disappointment at the lack of perfect uniformity on a screen which cost me £400 (over double what most 20 inch LCD screens cost), and I would like to know if anybody could possibly suggest a way to fix it?
It is upsetting, becuase although this problem exists on other screens too, this is, as far as I know, the most expensive 20" LCD monitor available today, and uses the best technology available too.
p.s. If anyone would like to use the program that lets you set your entire PC screen a specific colour, it is called "Dead Pixel Buddy", and it is a free piece of software, made by somebody to check for dead pixels. But I found it useful for other things too, including looking at how uniform the colour of the screen is. That's not to say I was specifically looking for this problem by the way... the problem cought my eye.
Thanks in advance!
Message was edited by: teleloveI've been talking about this on another forum too, and I made some pictures in photoshop to describe the problem. Here is what I posted on the other forum:
Yes, "brightness uniformity" definitely seems to be the best description of my issue.
Basically it just seems like there are very faint lines down the screen, that are slightly darker than the other areas on the screen. They aren't defined lines, and they aren't in a pattern. It's just slight areas that are darker, and the areas seem like narrow bands/lines. Usually you can't see it, but in some cases, it is quite noticeable. It is mainly when I'm playing a game. The slightly darker areas are not visible, and then when the image moves (because I am turning in a car, or turning a plane, or turning in a shooter etc.) the image moves, but these slightly darker areas stay still, and that makes them really stand out.
As for how it looks, I tried to make an example in photoshop:
Original Image:
http://img340.imageshack.us/img340/3045/td1ja9.jpg
Then imagine turning the car around a bend, and then it looks like this:
http://img266.imageshack.us/img266/959/td2hq7.jpg
It's those lines in the clouds. If you can tab between the two images, you can see the difference easily. Imagine seeing those lines appear, every single time you move in a game. (I haven't tested this in movies yet, but I am assuming it's the same).
It isn't very clear on a static image. But when the image moves, the darker areas stay in the same place and it draws your eyes towards them. It isn't terrible, but it is annoying, especially consider how much this screen cost.
Message was edited by: telelove -
Can you help with rematching file names
After a computer crash needed to reload my library. When doing this I accidently clicked the option to add track numbers to song names.
Later I was able to locate my iTunes XML from my old PC, however many of the songs (5000 out of 6000) no don't match because the original song name has been changed since my stupid error caused the files names to get the song number in front of them.
Anybody have any tips for matching the filenames back up. In my original library some files had track numbers in front and some did not. How can I match them back up. I'm comfortable programming and modifying the iTunes XML but I can't figure out a good way to list out the contents of my hard drive to do the actual matching.
TonyBecause this forum software is so absolutely USELESS now, you don't get to see the whole of the question in this view. In the other (non-list) view it says:
"can you help with a technical problem with the stereo imagery option ? it won't take out lead vocal in a stereo mp3"
And the answer is that if you can't isolate the vocal in the stereo field, or it is one of these odd ones where it's used inverted polarity in different parts of the stereo signal for the same vocal, then you won't be able to. But without a sample, it's impossible to tell. If you can post a link to one, that might help. It has to be external to this site though - Adobe in their infinite wisdom don't allow the posting of audio files on their audio U2U forum. Helpful, that, isn't it? -
Over this past weekend I was moving, via Relocate Masters, large numbers of images from managed status on my MacBook Pro to referenced status on an external drive (an Air Disk, to be precise). This had gone fine for thousands of images, but Sunday night I returned to the computer to find that it was completely locked up in mid-Relocate, and seemed to have been locked up for a while. I'm not sure what happened, but it seemed bad -- I couldn't get to the Force Quit dialog, or anywhere else. I powered down by holding in the power button.
Upon resurrecting things, Aperture would not open the library. Long story shorter, I rebuilt the database and was then able to see the library contents again. But then I noticed that many files were "offline." Digging further, and using the Manage Referenced Files box, I discovered that some 3500 files need to be reconnected.
The Reconnect All button did a little bit of magic for me, but now I've gotten to a point where using Reconnect All only reconnects one file at a time. I was renaming files as I Relocated Masters, and my fear is that this is what has caused the disconnect. *So first,* can anyone tell me that this is what has caused the problem (the problem being my apparent need to now reconnect 3400 files, one-by-one)?
*Second, and more importantly to me, do I have any recourse beyond reconnecting one-by-one?* Again, the problem seems to me to be that the library file expects a file named image.jpg (or whatever), because the change of the file name to greatimage.jpg that occurred during Relocation did not get written to the library file.
Many thanks for all help and suggestions.Homme dArs wrote:
I hope someone else can join in with a definitive answer to your problem, but I don't believe you will be happy using the configuration you are attempting to set up.
Having Aperture access your images via wireless is going to be very very slow, and any connection problems will be very frustrating. I have even abandoned the idea of using wireless backup of image files because it so slow.
Perhaps someone can help with your immediate problem, but I would strongly suggest you find a way to store your referenced files locally (a firewire drive would be ideal).
Thanks. I certainly appreciate your thought, and before trying it myself, my instinct was the same as yours. That said, until the present problem cropped up, I have to say it has been quite a good solution. My network is 802.11n, and I've noticed no real lag in accessing the files or otherwise using Aperture with a library stored as this is.
But yes, I hope someone is able to help me get these 3400-some files reconnected short of one-by-one.
Thank you for your comments. -
Can anyone help with icloud and apple accounts getting mixed up on 2 phones?
Basically husband upgraded from 4s to 5c. Gave dad 4s. I tried to set his dad up with icloud and apple id but didn't realise husbands old sim card was in 4s. Now neither phone works and husband very annoyed his apple id and password don't work anymore. Please help!!!
Hi Chris
So husband got new phone. Was all set up and up and running when we left the shop
Gave dad the old phone. It was locked to Vodafone so we had to ask them to unlock. He then got his three sim cut down to fit.
Weeks after husband had his 5c we went to dads to set his 4s up. I upgraded it to latest software iOS something. Anyway didn't realise it was husbands old sim still in phone.
After upgrade it asked me to set up apple account (I think) could have been icloud. Anyway I started setting it up with dads email and password choice. Husband then saw message on his 5c saying his dads email was being added to something on his phone.
At this point I left alone but now when husband tries to use his apple id for apps etc it says invalid user id or password. It's as though the 2 have got mixed up. Bit it won't let him reset his password?
Does this make sense? -
Need help with connecting file inputs to arrays
In this assignment I have a program that will do the following: display a list of names inputed by the user in reverse order, display any names that begin with M or m, and display any names with 5 or more letters. This is all done with arrays.
That was the fun part. The next part requires me to take the names from a Notepad file, them through the arrays and then output them to a second Notepad file.
Here is the original program: (view in full screen so that the code doesn't get jumbled)
import java.io.*; //Imports the Java library
class progB //Defines class
public static void main (String[] arguments) throws IOException
BufferedReader keyboard; //<-
InputStreamReader reader; // Allows the program to
reader = new InputStreamReader (System.in); // read the the keyboard
keyboard = new BufferedReader (reader); //<-
String name; //Assigns the name variable which will be parsed into...
int newnames; //...the integer variable for the amount of names.
int order = 0; //The integer variable that will be used to set the array size
String[] array; //Dynamic array (empty)
System.out.println (" How many names do you want to input?"); //This will get the number that will later define the array
name = keyboard.readLine ();
newnames = Integer.parseInt (name); // Converts the String into the Integer variable
array = new String [newnames]; //This defines the size of the array
DataInput Imp = new DataInputStream (System.in); //Allows data to be input into the array
String temp;
int length; //Defines the length of the array for a loop later on
for (order = 0 ; order < newnames ; order++) //<-
{ // Takes the inputed names and
System.out.println (" Please input name "); // gives them a number according to
temp = keyboard.readLine (); // the order they were inputed in
array [order] = temp; //<-
for (order = newnames - 1 ; order >= 0 ; order--) //<-
{ // Outputs the names in the reverse
System.out.print (" \n "); // order that they were inputed
System.out.println (" Name " + order + " is " + array [order]); //<-
for (order = 0 ; order < newnames ; order++) //<-
if (array [order].startsWith ("M") || array [order].startsWith ("m")) // Finds and outputs any and all
{ // names that begin with M or m
System.out.print (" \n "); //
System.out.println (array [order] + (" starts with M or m")); //
} //<-
for (order = 0 ; order < newnames ; order++) //<-
length = array [order].length (); //
if (length >= 5) // Finds and outputs names
{ // with 5 or more letters
System.out.print (" \n "); //
System.out.println ("Name " + array [order] + " have 5 or more letters "); //<-
}The notepad file contains the following names:
jim
laruie
tim
timothy
manny
joseph
matty
amanda
I have tried various methods but the one thing that really gets me is the fact that i can't find a way to connect the names to the arrays. Opening the file with FileInputStream is easy enough but using the names and then outputing them is quite hard. (unless i'm thinking too hard and there really is a simple method)By "connect", do you just mean you want to put the names into an array?
array[0] = "jim"
array[1] = "laruie"
and so on?
That shouldn't be difficult at all, provided you know how to open a file for reading, and how to read a line of text from it. You can just read the line of text, put it in the array position you want, until the file is exhausted. Then open a file for writing, loop through the array, and write a line.
What part of all that do you need help with? -
I would really appreciate any help on this! I have my itunes library on an external hard drive. The power adapter to that drive failed. I replaced it, but now when I open itunes it doesn't recognize where any of my files are. A friend told me to try to go into Edit>Preferences and find the drive of my hard drive and reset that as where the files are. That didn't work. I can go in manually and click on a song where the window pops up that itunes can't find the file, and I am able to find it and then it will play. But to do that with all files in my library would take forever. Thank you so much for any help!
(I have itunes 8)Try This. Hold the shift key down, and open iTunes. Do not let up on the shift key until you get a window that asks you to choose a library, or create a new library. If iTunes opens without giving you that choice, just close it and re-open it with the shift key down. Nine times out of Ten it works on the first try. Click "choose a library". You will get another window that allows you to navigate to your hard drive and show iTunes where your music is stored. In a folder called iTunes or iTunes Music, choose "iTunes Library.itl" This should bring back your entire library the way it was when you last used it.
Maybe you are looking for
-
hi all, have been working on my first site please have a look and tell me what you think http://web.mac.com/gareth.barlow/iWeb/mac%20time/Home.html it's not complete but just looking for some views on it, are there too many pages and are the colors o
-
Details on Microsoft File Server Migration Toolkit 1.2
We are planning to move our file server from a Server 2008 cluster (running on an outdated SAN) to a Server 2008 R2 cluster attached to a new SAN. The FSMT looks like the best way to accomplish this, but I have a few questions. 1. The docs don't ment
-
My little cousin scratched my i tunes gift card with a key and now I am not able to decipher the code on the back. Is there any way of still being able to redeem the gift card?
-
Using Spool to output data to file
I am trying to write some sql scripts to do spooling of data to files automatically on the 1st day of each month. I use the spool command to output to text file but have problems setting the filename to tag with the date stamp. Script 1 : to get curr
-
Read lines from text file to java prog
how can I read lines from input file to java prog ? I need to read from input text file, line after line 10x !