473,385 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Split big log file into Smaller one.

I have a huge text file that look like this:

2013/255-12:23:34 - Some event happen
2013/255-12:23:34 - Some event happen
2013/255-12:23:34 - Some event happen
2013/255-12:23:34 - Some event happen
2013/256-12:23:34 - Some event happen
2013/256-12:23:34 - Some event happen
2013/256-12:23:34 - Some event happen
2013/256-12:23:34 - Some event happen
2013/257-12:23:34 - Some event happen
2013/257-12:23:34 - Some event happen

I would like to use perl to split this file into smaller files with the date as file name.

So I would look like this when done:

2013_255.txt will contain:

2013/255-12:23:34 - Some event happen
2013/255-12:23:34 - Some event happen
2013/255-12:23:34 - Some event happen
2013/255-12:23:34 - Some event happen

2013_256.txt will contain:

2013/256-12:23:34 - Some event happen
2013/256-12:23:34 - Some event happen
2013/256-12:23:34 - Some event happen

2013_257.txt will contain:

2013/257-12:23:34 - Some event happen
2013/257-12:23:34 - Some event happen

Thanks,
Sep 20 '13 #1
1 1222
RonB
589 Expert Mod 512MB
We are not a code writing service, but we will help you troubleshoot your code.

What have you tried?

What part is giving you trouble?

What errors/warnings are you getting?
Sep 20 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Martijn Ras | last post by:
Heya folks, I ran into the following problem: When i run this on Windows everything is as expected: C:\>python Python 2.2.3 (#42, May 30 2003, 18:12:08) on win32 Type "help", "copyright",...
3
by: Dominik Stadler | last post by:
Hi, We have a file that contains multiple XML-Messages in the form of: <FIRSTMESSAGE>...</FIRSTMESSAGE><SECONDMESSAGE>...</SECONDMESSAGE> I know this looks broken from the beginning, but we...
4
by: Carsten Kraft | last post by:
Hello Newsgroup, I am searching for function which returns me filename from a string that has the file + filepath. ( string sFile = "C:\DIR\SUBDIR\TEST.XML" => TEST.XML) Is there a...
8
by: Janelle.Dunlap | last post by:
My database is linked to external data from a single Excel spreadsheet. I currently have it so that the entire spreadsheet exports into one table, but really for the purpose of my database it will...
6
by: Stan | last post by:
I am working on a database in ACCESS 2003. This is a simple DB with only one table. I have split the DB so I can upgrade and debug the front end before installing on my clients' computer. I used...
1
by: JayDog | last post by:
I have a large data file that I split into smaller more manageable chunks (went from a 12.86 GB file to 500 MB - 1.6 GB chunks). I now want to add to the PERL script and go back through those more...
3
by: bomber71 | last post by:
Hi, I want to take read an input file (sels.txt) that looks like: Begin sels sel1 = {1001, 1002, 1003, ... ... 1099} sel2 = {1001, 1008, 1009 ...
1
by: dopplereffekt | last post by:
Hello.I need a help.I have some huge files (about 2-5 GB) on the on of file hosting services.Now, I want to create rar archives,add this files to this archives and split into smaller size volumes...
4
by: David Greenberg | last post by:
Hi I have a backup device file ... ".bck" whick has grown pretty large. Is there any way I can reduce its size ? Thanks David Greenberg
7
by: John Smith | last post by:
Hi, I am very new to C# and NET framework. I am trying to hash (using MD5CryptoServiceProvider) a source that is split into several files. Now when the source is in one file I can produce the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.