LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-29-2009, 10:09 PM   #1
tmaxx
LQ Newbie
 
Registered: Jun 2006
Posts: 21

Rep: Reputation: 15
listing text log file


hi guys newbie here. need help

i have a text file which contains:


0978678787,reminder of your pending trans:,VL 1,OT 1,PL 4
0944673451,reminder of your pending trans:,VL 5,OT 3,PL 4
0934678787,reminder of your pending trans:,VL 6,OT 2,PL 5


so

basically this contains mobile numbers and message to send..

i want to create a script that separates each line to a new file


like file 1 contains:

0978678787,reminder of your pending trans:,VL 1,OT 1,PL 4

file 2 contains

0944673451,reminder of your pending trans:,VL 5,OT 3,PL 4

and so on...

thanks in advance..

Last edited by tmaxx; 05-29-2009 at 10:12 PM.
 
Old 05-29-2009, 11:43 PM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Code:
awk '{print > "file_"NR".txt"}' file
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
text match pipe to file then delete from original text file create new dir automatic tr1px Linux - Newbie 6 09-10-2008 09:40 PM
How to parse text file to a set text column width and output to new text file? jsstevenson Programming 12 04-23-2008 02:36 PM
Write Error Log to Text File jamez15 Linux - General 3 07-02-2006 07:32 PM
Show LFs & TABs in listing text files fiomba Linux - Software 0 12-02-2005 03:58 AM
Alphabetical Listing of Text trihai44100 Linux - Software 1 03-13-2004 11:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration