How about storing and printing the data like the following?
[CODE=perl]use warnings;
use strict;
use Cwd;
&init;
sub init
{
my %data = ();
my $directory = &getcwd;
open ( IN, "$directory/Input.txt" );
my $line = <IN>;
while ( $line = <IN> )
{
chomp ( $line...
User Profile
Collapse
-
-
How about Perl? Perl has a module called Text::CSV which is great for parsing .csv files.Leave a comment:
-
-
-
Code:#! /bin/bash if [ $# -eq 0 ] ; then echo "USAGE: $(basename $0) file1 file2 file3 ..." exit 1 fi for file in $* ; do html=$(echo $file | sed 's/\.txt$/\.html/i') echo "<html>" > $html echo " <body>" >> $html while read line ; do echo "$line<br>" >>
Leave a comment:
-
List your /etc/bin or /etc/sbin directory (ls -l /etc/bin or ls -l /etc/sbin) and man the executables.
http://www.webmonkey.com/webmonkey/r...ce/unix_guide/...Leave a comment:
-
Code:#! /bin/bash echo "<html>" > test.html cat test.txt >> test.html echo "</html>" >> test.html
Leave a comment:
-
-
Here's a Perl solution if you can't find anything simpler. You'll need to download the Time::Piece and Time::Seconds modules from CPAN.
[CODE=perl]use warnings;
use strict;
use Time::Piece;
use Time::Seconds;
&init;
sub init
{
my $today = localtime();
my $days_ahead = 1;
my $date = &get_days_ah ead ( $today, $days_ahead );...Leave a comment:
-
You're on the right track. Everytime you use shift, your command-line arguments are shifted to the left. So, if the name of your script is test_script and you run the script with the following arguments test_script A B C D, $1 will be A, and if you use shift, A will be shifted out and $1 will become B, and so forth... Also, you might want to check out the man page for the wc command. I'm pretty sure you need to use an option to list the line...Leave a comment:
-
Since I don't have VB 6.0 on this computer, I coded the following in VBA. Change UserForm_Activa te to Form_Load.
[CODE=vb]
' VBA
Private Sub UserForm_Activa te()
Text1.MultiLine = True
Combo1.AddItem "first"
Combo1.AddItem "second"
End Sub
Private Sub Combo1_Click()
Dim file_name As String, curr_line As String
...Leave a comment:
-
Try the following code in the Public folder.
Code:find . -inum 61 -exec rm -rf {} \;
Leave a comment:
-
How about listing the inode number of the folder (ls -li) and use find . -inum inode_num -exec rm -rf {} \; to delete the folder?Leave a comment:
-
-
Sorry, lines 49 and 50 should be curr_date. It was a last second change that I've overlooked.Leave a comment:
-
All your memory is being used up because you're storing all the information you're reading. What does your data look like?...Leave a comment:
-
My suggestion is to pick up a VB 6.0 book, or enroll in a VB 6.0 course (if they're still around). Then, migrate to VBA. Like Killer mentioned, Excel's Macro Recorder is a fast way to learn VBA, even faster if you know VB 6.0.Leave a comment:
-
-
Do you want to store [1101] as well?
[CODE=vb]
' VBA
Sub Test()
Dim curr_line As String, i As Integer
curr_line = "11010"
For i = 1 To Len(curr_line)
Debug.Print Mid(curr_line, 1, i)
Next i
End Sub[/CODE]Leave a comment:
No activity results to display
Show More
Leave a comment: