File: cleanup.pl

package info (click to toggle)
linux-minidisc 0.9.13-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,096 kB
  • ctags: 1,530
  • sloc: ansic: 6,345; cpp: 2,569; python: 2,451; perl: 866; sh: 22; makefile: 8
file content (27 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

# This program takes in logs saved from DebugView.exe in windows and gets
# rid of the line number and timestamp fields (tab seperated)
sub trim
{
	my @out = @_;
	for (@out) 
	{
		s/^\s+//;
		s/\s+$//;
	}
	return wantarray ? @out : $out[0];
}

foreach $MyFile (@ARGV)
{
	$OutFile = $MyFile . ".clean";
	print "$OutFile\n";
	open(FILE, $MyFile);
	open(FILE2, ">$OutFile");
	while (<FILE>)
	{
		($junk, $junk2, $data) = split(/\t/, $_, 3);
		print  FILE2 "$data";
	}
}